From 5dcc65f8913a9b2177b5b3ce649c79672d35f403 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Fri, 28 Jan 2022 15:33:30 +0800 Subject: [PATCH] fix: tag release images too --- .github/workflows/release.yaml | 4 ++- .github/workflows/tag-to-release.yaml | 38 ++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c35ca504..ac5cd685 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -68,7 +68,9 @@ jobs: binary: - service-api - ssh-portal - needs: release + needs: + - tag + - release runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/tag-to-release.yaml b/.github/workflows/tag-to-release.yaml index 0427a785..05335b92 100644 --- a/.github/workflows/tag-to-release.yaml +++ b/.github/workflows/tag-to-release.yaml @@ -22,6 +22,29 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload binaries + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + releaseimage: + strategy: + matrix: + binary: + - service-api + - ssh-portal + needs: + - tag + - release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Download binaries + uses: actions/download-artifact@v2 + with: + name: dist + path: dist - name: Login to GHCR uses: docker/login-action@v1 with: @@ -29,16 +52,17 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Docker metadata - id: service_api_meta + # this id is namespaced per matrix run + id: docker_metadata uses: docker/metadata-action@v3 with: - images: uselagoon/lagoon-ssh-portal/service-api - - name: Build and push service-api container image + images: ghcr.io/uselagoon/lagoon-ssh-portal/${{ matrix.binary }} + - name: Build and push ${{ matrix.binary }} container image id: docker_build uses: docker/build-push-action@v2 with: push: true - tags: ghcr.io/${{ steps.service_api_meta.outputs.tags }} - labels: ${{ steps.service_api_meta.outputs.labels }} - file: deploy/service-api/Dockerfile - context: dist/lagoon-ssh-portal_linux_amd64 + tags: ${{ steps.docker_metadata.outputs.tags }} + labels: ${{ steps.docker_metadata.outputs.labels }} + file: deploy/${{ matrix.binary }}/Dockerfile + context: dist/${{ matrix.binary }}_linux_amd64