From 08cf5e30419a9d20bf24339b9ccd0ab7c36bee60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Tue, 23 May 2023 23:27:44 +0200 Subject: [PATCH] chore: delay static asset generation (#3848) ## About the changes Delay static asset generation to speed up the CI/CD pipeline. Next, we should add a validation step before deployment to validate that the static assets were properly published --- .github/workflows/notify_enterprise.yaml | 37 +++++++++++++----------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/notify_enterprise.yaml b/.github/workflows/notify_enterprise.yaml index cdf9ea6d54b..1c1f589e163 100644 --- a/.github/workflows/notify_enterprise.yaml +++ b/.github/workflows/notify_enterprise.yaml @@ -21,6 +21,26 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Trigger sync + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.UNLEASH_CI_BUILDER_GITHUB_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: 'ivarconr', + repo: 'unleash-enterprise', + workflow_id: 'cicd.yaml', + ref: 'master', + inputs: { + repository: "${{ github.repository }}", + commit: "${{ github.event.head_commit.id }}", + actor: "${{ github.actor }}", + message: ${{ toJSON(github.event.head_commit.message) }}, + } + }) + + # build static assets after triggering the sync workflow. + # Adding a validation step in the sync workflow will ensure that the static assets are built before deployment. - name: Build static assets run: | cd frontend @@ -40,20 +60,3 @@ jobs: - name: Publish static assets to S3 run: | aws s3 cp frontend/build s3://getunleash-static/unleash/commits/${{ steps.get_commit_hash.outputs.COMMIT_HASH }} --recursive - - name: Trigger sync - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.UNLEASH_CI_BUILDER_GITHUB_TOKEN }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: 'ivarconr', - repo: 'unleash-enterprise', - workflow_id: 'cicd.yaml', - ref: 'master', - inputs: { - repository: "${{ github.repository }}", - commit: "${{ github.event.head_commit.id }}", - actor: "${{ github.actor }}", - message: ${{ toJSON(github.event.head_commit.message) }}, - } - })