Skip to content

Commit

Permalink
update push-action to v2
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Balogh <[email protected]>
  • Loading branch information
pbalogh-sa committed Sep 17, 2020
1 parent ef628b6 commit 2d7c827
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,45 @@ jobs:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Checkout code
uses: actions/checkout@v2
- name: Build banzai-cli
uses: docker/build-push-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Determine tag or commit
uses: haya14busa/action-cond@v1
id: refortag
with:
cond: ${{ startsWith(github.ref, 'refs/tags/') }}
if_true: ${{ github.ref }}
if_false: latest
- name: Determine image tag
id: imagetag
run: echo "::set-output name=value::${TAG_OR_BRANCH##*/}"
env:
TAG_OR_BRANCH: ${{ steps.refortag.outputs.value }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
registry: ghcr.io
repository: banzaicloud/banzai-cli
dockerfile: Dockerfile
tag_with_ref: true
add_git_labels: true
tags: latest
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build banzai-cli
uses: docker/build-push-action@v2
with:
tags: ghcr.io/banzaicloud/banzai-cli:${{ steps.imagetag.outputs.value }}
file: Dockerfile
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

0 comments on commit 2d7c827

Please sign in to comment.