Empty commit #10
Workflow file for this run
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
name: Production deployment | |
on: | |
push: | |
branches: | |
- kvittering-frontend-2 | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deploy-kvittering-frontend: | |
name: Deploy monoweb/kvittering-frontend | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-north-1 | |
role-to-assume: arn:aws:iam::891459268445:role/MonowebProdKvitteringFrontendCIRole | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 9.15.7 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.0.0 | |
cache: 'pnpm' | |
- name: Install dependencies | |
working-directory: apps/kvittering-frontend | |
run: pnpm install | |
- name: Build frontend | |
working-directory: apps/kvittering-frontend | |
run: pnpm build | |
- name: Deploy to S3 | |
run: | | |
aws s3 sync apps/kvittering-frontend/dist "s3://kvittering.online.ntnu.no" \ | |
--exclude "*" \ | |
--include "*.html" \ | |
--content-type "text/html" \ | |
--region "eu-north-1" | |
aws s3 sync apps/kvittering-frontend/dist "s3://kvittering.online.ntnu.no" \ | |
--exclude "*" \ | |
--include "*.css" \ | |
--content-type "text/css" \ | |
--region "eu-north-1" | |
aws s3 sync apps/kvittering-frontend/dist "s3://kvittering.online.ntnu.no" \ | |
--exclude "*" \ | |
--include "*.js" \ | |
--content-type "application/javascript" \ | |
--region "eu-north-1" | |
aws s3 sync apps/kvittering-frontend/dist "s3://kvittering.online.ntnu.no" \ | |
--exclude "*" \ | |
--include "*.svg" \ | |
--content-type "image/svg+xml" \ | |
--region "eu-north-1" | |
aws s3 sync apps/kvittering-frontend/dist "s3://kvittering.online.ntnu.no" \ | |
--exclude "*.html" \ | |
--exclude "*.css" \ | |
--exclude "*.js" \ | |
--exclude "*.svg" \ | |
--region "eu-north-1" | |
- name: Invalidate CloudFront cache | |
run: aws cloudfront create-invalidation --distribution-id E60JFQ13PM11R --paths '/*' | |
deploy-kvittering-backend: | |
name: Deploy monoweb/kvittering-backend | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-north-1 | |
role-to-assume: arn:aws:iam::891459268445:role/MonowebProdKvitteringBackendCIRole | |
- uses: aws-actions/amazon-ecr-login@v2 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64 | |
context: . | |
file: apps/kvittering-backend/Dockerfile | |
tags: 891459268445.dkr.ecr.eu-north-1.amazonaws.com/monoweb/prod/kvittering-backend:latest | |
push: true | |
- uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.TERRAFORM_WORKFLOW_TOKEN }} | |
script: | | |
await github.rest.actions.createWorkflowDispatch({ | |
owner: 'dotkom', | |
repo: 'terraform-monorepo', | |
workflow_id: 'apply.yml', | |
ref: 'main', | |
inputs: { | |
environment: 'prod', | |
project: 'monoweb-kvittering-backend', | |
targets: 'module.evergreen_service', | |
}, | |
}); |