From e75d96e2b541da9d6d758852a8cf0efbb4366f46 Mon Sep 17 00:00:00 2001 From: Risto Salama Date: Thu, 16 May 2024 14:26:06 +0300 Subject: [PATCH] Enable deploy --- .github/workflows/build.yml | 9 +++++---- .github/workflows/deploy.yml | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 266f225c..47fc75b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,8 +63,7 @@ jobs: path: playwright-report/ retention-days: 10 deploy-zip: - if: false - needs: [lint, test, e2e] + #needs: [lint, test, e2e] timeout-minutes: 30 runs-on: ubuntu-latest permissions: @@ -80,11 +79,13 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 with: - role-to-assume: ${{ secrets.AWS_OPINTOPOLKU_DEV_ROLE_ARN }} + role-to-assume: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} role-session-name: valintojen-toteuttaminen-deploy-zip aws-region: eu-west-1 - name: Deploy zip to s3 + env: + bucket: ${{ secrets.BUCKET_NAME }} run: | npm run build zip -r GA-${{github.run_number}}.zip .next/standalone - aws s3 cp GA-${{github.run_number}}.zip s3://${{secrets.BUCKET_NAME}}/GA-${{github.run_number}} + aws s3 cp GA-${{github.run_number}}.zip s3://"$bucket"/GA-${{github.run_number}}.zip diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4c68620e..c1d3a233 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,14 +32,16 @@ jobs: if: ${{ inputs.environment == 'hahtuva' || inputs.environment == 'untuva' || inputs.environment == 'pallero' }} uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 with: - role-to-assume: ${{ secrets.AWS_OPINTOPOLKU_DEV_ROLE_ARN }} + role-to-assume: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} role-session-name: valintojen-toteuttaminen-deploy aws-region: eu-west-1 - name: Download build from s3 + env: + bucket: ${{ secrets.BUCKET_NAME }} run: | - aws s3 cp s3://${{secrets.BUCKET_NAME}}//GA-${{inputs.build-number}} build.zip + aws s3 cp s3://"$bucket"//GA-${{inputs.build-number}}.zip build.zip unzip build.zip - name: Deploy Next.js app run: | cd cdk - ./deploy.sh ${{ inputs.environment }}untuva deploy + ./deploy.sh ${{ inputs.environment }} deploy