-
-
Notifications
You must be signed in to change notification settings - Fork 320
71 lines (57 loc) · 1.67 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy
concurrency:
group: production
cancel-in-progress: true
on:
push:
branches: [main]
permissions:
id-token: write
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn --immutable
- name: Build
run: yarn build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: package
path: dist
include-hidden-files: true
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
environment:
name: production
url: https://projects.wojtekmaj.pl
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: package
path: dist
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::692859910433:role/GitHubActionsProjects
aws-region: eu-central-1
- name: Deploy
run: |
aws s3 cp --recursive --cache-control 'public, max-age=31557600' ./dist s3://$S3_BUCKET/react-lifecycle-methods-diagram
aws s3 cp --metadata-directive REPLACE --cache-control 'public, max-age=180' --content-type 'text/html' s3://$S3_BUCKET/react-lifecycle-methods-diagram/index.html s3://$S3_BUCKET/react-lifecycle-methods-diagram/index.html
env:
S3_BUCKET: wojtekmaj-projects