-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OK-735: Testataan uin github deploymenttia
- Loading branch information
Showing
2 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Ovara UI deploy | ||
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: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- name: Install NPM dependencies | ||
run: | | ||
npm ci | ||
cd cdk | ||
npm ci | ||
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: ovara-ui-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 OvaraUISovellusStack --require-approval never -c "environment=${{ inputs.environment }}" -c "skipBuild=true" |