From 1c4dc3d62a086b41ee920d45578cef3f11e0fcb7 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 11 Jul 2023 02:14:51 +0200 Subject: [PATCH] ci(bats-assert): align actions versions and push events Signed-off-by: CrazyMax --- .github/workflows/bats-assert.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bats-assert.yml b/.github/workflows/bats-assert.yml index efc395e..94b4fd9 100644 --- a/.github/workflows/bats-assert.yml +++ b/.github/workflows/bats-assert.yml @@ -4,13 +4,10 @@ on: push: branches: - 'master' - - 'v2' paths: - '.github/workflows/bats-assert.yml' - 'util/bats-assert/**' pull_request: - branches: - - 'master' paths: - '.github/workflows/bats-assert.yml' - 'util/bats-assert/**' @@ -19,22 +16,29 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: docker/setup-qemu-action@v1 - - uses: docker/setup-buildx-action@v1 + - name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Test working-directory: ./util/bats-assert run: docker buildx bake test - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1.6.0 + if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Publish - if: github.ref == 'pull_refs/heads/master' - working-directory: ./util/bats-assert - run: docker buildx bake all --push + uses: docker/bake-action@v2 + with: + workdir: ./util/bats-assert + targets: all + push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}