From 9f0d1b9106f1d47062ee96a69833183873ae8297 Mon Sep 17 00:00:00 2001 From: Shane Smith Date: Mon, 12 Feb 2024 09:21:32 -0600 Subject: [PATCH] fix: pulling from previous job --- .github/workflows/release-deploy.yml | 30 ++++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-deploy.yml b/.github/workflows/release-deploy.yml index cfd5e43c3b..f1aab5f1b3 100644 --- a/.github/workflows/release-deploy.yml +++ b/.github/workflows/release-deploy.yml @@ -20,6 +20,10 @@ jobs: setup: needs: [lint-test-build] runs-on: ubuntu-latest + outputs: + ecr_registry: ${{ steps.login-ecr.outputs.registry }} + postfix: ${{ env.postfix }} + gitsha: ${{ steps.gitsha.outputs.value }} steps: # # Setup Auth token to push to github packages - name: Set NPM Config @@ -56,10 +60,6 @@ jobs: role-duration-seconds: 1200 role-session-name: SageECRPushSession - build_and_push: - needs: [setup] - runs-on: ubuntu-latest - steps: - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v1 @@ -98,13 +98,17 @@ jobs: - name: Checkout uses: actions/checkout@v2 + build_and_push: + needs: [setup] + runs-on: ubuntu-latest + steps: # Docs Site - name: Build and push docs site uses: docker/build-push-action@v2 env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REGISTRY: ${{ needs.setup.outputs.ecr_registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_SAGE_DOCS }} - IMAGE_SHA_TAG: ${{ steps.gitsha.outputs.value }} + IMAGE_SHA_TAG: ${{ needs.setup.outputs.gitsha }} with: file: ./docs/Dockerfile build-args: | @@ -112,15 +116,15 @@ jobs: context: ./docs push: true tags: | - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_DOCS }}:${{ steps.gitsha.outputs.value }}-release-${{ env.postfix }} + ${{ needs.setup.outputs.ecr_registry }}/${{ secrets.ECR_REPOSITORY_SAGE_DOCS }}:${{ needs.setup.outputs.gitsha }}-release-${{ needs.setup.outputs.postfix }} # Storybook Site - name: Build and push storybook uses: docker/build-push-action@v2 env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REGISTRY: ${{ needs.setup.outputs.ecr_registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_SAGE_STORYBOOK }} - IMAGE_SHA_TAG: ${{ steps.gitsha.outputs.value }} + IMAGE_SHA_TAG: ${{ needs.setup.outputs.gitsha }} with: file: ./packages/sage-react/Dockerfile build-args: | @@ -128,15 +132,15 @@ jobs: context: ./packages/sage-react/ push: true tags: | - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_STORYBOOK }}:${{ steps.gitsha.outputs.value }}-release-${{ env.postfix }} + ${{ needs.setup.outputs.ecr_registry }}/${{ secrets.ECR_REPOSITORY_SAGE_STORYBOOK }}:${{ needs.setup.outputs.gitsha }}-release-${{ needs.setup.outputs.postfix }} # Sassdocs Site - name: Build and push sassdocs uses: docker/build-push-action@v2 env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REGISTRY: ${{ needs.setup.outputs.ecr_registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_SAGE_SASSDOCS }} - IMAGE_SHA_TAG: ${{ steps.gitsha.outputs.value }} + IMAGE_SHA_TAG: ${{ needs.setup.outputs.gitsha }} with: file: ./packages/sage-assets/Dockerfile build-args: | @@ -144,4 +148,4 @@ jobs: context: ./packages/sage-assets/ push: true tags: | - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_SAGE_SASSDOCS }}:${{ steps.gitsha.outputs.value }}-release-${{ env.postfix }} + ${{ needs.setup.outputs.ecr_registry }}/${{ secrets.ECR_REPOSITORY_SAGE_SASSDOCS }}:${{ needs.setup.outputs.gitsha }}-release-${{ needs.setup.outputs.postfix }}