From 4c410a00cbbab79859694c477b6edbaa4cfe602e Mon Sep 17 00:00:00 2001 From: Colin Hutchinson Date: Tue, 4 Jan 2022 00:12:56 +0000 Subject: [PATCH 1/2] feat(sha): build sha's for main even when there is no release --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93b83fc..18af095 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,15 @@ jobs: uses: ahmadnassri/action-semantic-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + if: steps['release']['outputs']['published'] != 'true' + id: meta + uses: crazy-max/ghaction-docker-meta@v3 + with: + images: ${{ github.repository }} + tags: | + type=ref,event=branch + type=sha - name: Docker meta if: steps['release']['outputs']['published'] == 'true' id: meta @@ -44,13 +53,13 @@ jobs: type=ref,event=branch type=sha - name: Login to DockerHub - if: steps['release']['outputs']['published'] == 'true' + if: github.ref == 'refs/heads/main' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Build & Push - if: steps['release']['outputs']['published'] == 'true' + if: github.ref == 'refs/heads/main' uses: docker/bake-action@v1 with: push: 'true' From 8a70f35e695e4dd54f423a7475c47339351739fc Mon Sep 17 00:00:00 2001 From: Colin Hutchinson Date: Tue, 4 Jan 2022 00:17:50 +0000 Subject: [PATCH 2/2] fix(gha): tiny fix for github actions --- .github/workflows/release.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18af095..74adb77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,16 +34,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Docker meta - if: steps['release']['outputs']['published'] != 'true' - id: meta - uses: crazy-max/ghaction-docker-meta@v3 - with: - images: ${{ github.repository }} - tags: | - type=ref,event=branch - type=sha - - name: Docker meta - if: steps['release']['outputs']['published'] == 'true' id: meta uses: crazy-max/ghaction-docker-meta@v3 with: @@ -53,13 +43,11 @@ jobs: type=ref,event=branch type=sha - name: Login to DockerHub - if: github.ref == 'refs/heads/main' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Build & Push - if: github.ref == 'refs/heads/main' uses: docker/bake-action@v1 with: push: 'true'