diff --git a/.github/workflows/prod-docker.yml b/.github/workflows/prod-docker.yml index 222da9cb..e65297e2 100644 --- a/.github/workflows/prod-docker.yml +++ b/.github/workflows/prod-docker.yml @@ -40,12 +40,18 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 100 + + - name: Get tags + run: git fetch --tags origin + + - name: Get latest release tag + shell: bash + id: release_tag + run: echo TAG=$(git describe --tags HEAD --abbrev=0) >> $GITHUB_OUTPUT + - name: Set up Docker Buildx - id: buildx - # Use the action from the master, as we've seen some inconsistencies with @v1 - # Issue: https://github.com/docker/build-push-action/issues/286 + id: buildx uses: docker/setup-buildx-action@master - # Only worked for us with this option on with: install: true @@ -53,7 +59,6 @@ jobs: uses: actions/cache@v2 with: path: /tmp/.buildx-cache - # Key is named differently to avoid collision key: ${{ runner.os }}-${{ env.ENV }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-${{ env.ENV }}-buildx @@ -70,10 +75,7 @@ jobs: with: images: aeternity/superhero-backend tags: | - type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'main') }} - type=raw,value=${{ needs.release.outputs.tag_name }},enable=${{ endsWith(GitHub.ref, 'main') }} - type=ref,event=tag - type=ref,event=pr + type=raw,value=${{ steps.release_tag.outputs.TAG }} - name: Build and push docker image if: | @@ -87,9 +89,6 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=local,src=/tmp/.buildx-cache - # Note the mode=max here - # More: https://github.com/moby/buildkit#--export-cache-options - # And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new - name: Move cache @@ -99,7 +98,8 @@ jobs: - uses: actions/checkout@v2 with: - repository: aeternity/gitops-apps.git + repository: aeternity/gitops-apps-aelabs.git + token: ${{ secrets.BOT_GITHUB_TOKEN }} ref: prd persist-credentials: false fetch-depth: 0 @@ -107,13 +107,13 @@ jobs: - name: Production Deploy uses: aeternity/ae-github-actions/argocd-deploy@v4 with: - url-prefix: ${{ needs.release.outputs.tag_name }} + url-prefix: ${{ steps.release_tag.outputs.TAG }} env: ${{ env.ENV }} app: ${{ env.APP }} - name: Push changes uses: ad-m/github-push-action@master with: - repository: aeternity/gitops-apps + repository: aeternity/gitops-apps-aelabs github_token: ${{ secrets.BOT_GITHUB_TOKEN }} branch: prd