This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (56 loc) · 1.92 KB
/
ci.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
name: Continuous Integration
on:
push:
branches:
- next-release
concurrency:
group: ${{ github.ref }}
jobs:
lint-node:
uses: ./.github/workflows/lint-node.yaml
secrets: inherit
test-node:
uses: ./.github/workflows/test-node.yaml
secrets: inherit
check-types:
uses: ./.github/workflows/check-types.yaml
secrets: inherit
deploy-components:
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
runs-on: ubuntu-latest
needs: [check-types, lint-node, test-node]
permissions:
id-token: write
contents: read
environment: production
env:
env: production
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set env
run: cat env/${{ env.env }}/build.env >> $GITHUB_ENV
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: eu-west-1
role-to-assume: ${{ env.IAM_ROLE }}
- name: Set AWS Credentials file
shell: bash
run: |
aws configure set aws_session_token ${{ env.AWS_SESSION_TOKEN }} --profile ${{ env.AWS_PROFILE }}
aws configure set aws_access_key_id ${{ env.AWS_ACCESS_KEY_ID }} --profile ${{ env.AWS_PROFILE }}
aws configure set aws_secret_access_key ${{ env.AWS_SECRET_ACCESS_KEY }} --profile ${{ env.AWS_PROFILE }}
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'
- name: Build
run: |
yarn && yarn deploy:${{ env.YARN_BUILD }}
- name: Deploy
run: aws s3 sync ./dist s3://${{ env.S3_BUCKET }} --profile ${{ env.AWS_PROFILE }}
- name: Invalidate CloudFront
run: aws cloudfront create-invalidation --distribution-id ${{ env.DISTRIBUTION_ID }} --paths '/*'