-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (47 loc) · 1.48 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Valintojen toteuttaminen deploy
env:
HUSKY: 0
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
inputs:
build-number:
type: number
description: Github Actions build number
environment:
type: choice
description: Environment where to deploy
options:
- untuva
- hahtuva
- pallero
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-next-env
- name: Install CDK dependencies
run: |
cd cdk
npm ci --prefer-offline
npm install -g aws-cdk
- name: Configure AWS credentials
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-session-name: valintojen-toteuttaminen-deploy
aws-region: eu-west-1
- name: Download build from s3
env:
bucket: ${{ secrets.BUCKET_NAME }}
run: |
aws s3 cp --no-progress s3://"$bucket"/ga-${{inputs.build-number}}.zip build.zip
unzip build.zip
- name: Deploy Next.js app
run: |
cd cdk
cdk deploy SovellusStack --require-approval never -c "environment=${{ inputs.environment }}" -c "skipBuild=true"