Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating docker action from v1 to v2 in GH Action #341

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- run: ./ci-checks.sh
docker-images:
env:
CGO_ENABLED: 0
runs-on: ubuntu-latest
needs: [validation]
steps:
- name: Docker Image Tag for Sha
id: docker-image-tag
run: |
echo ::set-output name=tink-server-tags::quay.io/tinkerbell/tink:latest,quay.io/tinkerbell/tink:sha-${GITHUB_SHA::8}
echo ::set-output name=tink-cli-tags::quay.io/tinkerbell/tink-cli:latest,quay.io/tinkerbell/tink-cli:sha-${GITHUB_SHA::8}
echo ::set-output name=tink-worker-tags::quay.io/tinkerbell/tink-worker:latest,quay.io/tinkerbell/tink-worker:sha-${GITHUB_SHA::8}
- name: Checkout code
uses: actions/checkout@v2
- name: Download tink-cli binary
Expand All @@ -77,36 +81,35 @@ jobs:
run: chmod +x ./cmd/tink-cli/tink-cli
- name: set tink-server permission
run: chmod +x ./cmd/tink-server/tink-server
- name: quay.io/tinkerbell/tink
uses: docker/build-push-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
repository: tinkerbell/tink
path: ./cmd/tink-server/
registry: quay.io
- name: quay.io/tinkerbell/tink
uses: docker/build-push-action@v2
with:
context: ./cmd/tink-server/
file: ./cmd/tink-server/Dockerfile
cache-from: type=registry,ref=quay.io/tinkerbell/tink:latest
push: ${{ startsWith(github.ref, 'refs/heads/master') }}
tags: latest
tag_with_sha: true
tags: ${{ steps.docker-image-tag.outputs.tink-server-tags }}
- name: quay.io/tinkerbell/tink-cli
uses: docker/build-push-action@v1
uses: docker/build-push-action@v2
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
repository: tinkerbell/tink-cli
path: ./cmd/tink-cli/
registry: quay.io
context: ./cmd/tink-cli/
file: ./cmd/tink-cli/Dockerfile
cache-from: type=registry,ref=quay.io/tinkerbell/tink-cli:latest
push: ${{ startsWith(github.ref, 'refs/heads/master') }}
tags: latest
tag_with_sha: true
tags: ${{ steps.docker-image-tag.outputs.tink-cli-tags }}
- name: quay.io/tinkerbell/tink-worker
uses: docker/build-push-action@v1
uses: docker/build-push-action@v2
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
repository: tinkerbell/tink-worker
path: ./cmd/tink-worker/
registry: quay.io
context: ./cmd/tink-worker/
file: ./cmd/tink-worker/Dockerfile
cache-from: type=registry,ref=quay.io/tinkerbell/tink-worker:latest
push: ${{ startsWith(github.ref, 'refs/heads/master') }}
tags: latest
tag_with_sha: true
tags: ${{ steps.docker-image-tag.outputs.tink-worker-tags }}