From 74ba467dfd21a325e2614fbc0882c475859cee9f Mon Sep 17 00:00:00 2001 From: Andreas Hasenkopf Date: Tue, 17 Oct 2023 16:10:06 +0200 Subject: [PATCH] Use outputs to set image name --- .github/workflows/on_tag.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on_tag.yml b/.github/workflows/on_tag.yml index 8c6dfdf..29e90c2 100644 --- a/.github/workflows/on_tag.yml +++ b/.github/workflows/on_tag.yml @@ -5,6 +5,8 @@ on: [push] jobs: build-api: runs-on: ubuntu-latest + outputs: + imagename: ${{ steps.image.name }} steps: - name: 'Checkout GitHub Action' uses: actions/checkout@main @@ -15,12 +17,14 @@ jobs: username: ${{github.actor}} password: ${{secrets.GITHUB_TOKEN}} - name: 'Build API image' + id: image run: | docker build backend/ \ --tag ghcr.io/${GITHUB_REPOSITORY,,}/api:${GITHUB_REF_NAME,,} \ --tag ghcr.io/${GITHUB_REPOSITORY,,}/api:latest docker push ghcr.io/${GITHUB_REPOSITORY,,}/api:${GITHUB_REF_NAME,,} docker push ghcr.io/${GITHUB_REPOSITORY,,}/api:latest + echo "name=${ghcr.io/${GITHUB_REPOSITORY,,}/api:${GITHUB_REF_NAME,,}}" >> $GITHUB_OUTPUT build-ui: runs-on: ubuntu-latest steps: @@ -42,7 +46,7 @@ jobs: test: needs: build-api runs-on: ubuntu-latest - container: ghcr.io/${{GITHUB_REPOSITORY,,}}/api:${{GITHUB_REF_NAME,,}} + container: ${{ needs.build-api.outputs.imagename }} services: postgres: image: postgres:latest