generated from mirumirumi/template-nuxt3
-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.2 KB
/
deploy.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: deploy
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.12.2
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: npm ci
- name: Install Python modules
run: pip3 install httpx
- name: Decrypt secrets with gpg
run: |
echo "${{ secrets.GPG_PASSPHRASE }}" \
| sudo gpg --batch --passphrase-fd 0 --output "src/secrets/secret.dev.js" --decrypt "src/secrets/secret.dev.js.gpg"
echo "${{ secrets.GPG_PASSPHRASE }}" \
| sudo gpg --batch --passphrase-fd 0 --output "src/secrets/secret.prd.js" --decrypt "src/secrets/secret.prd.js.gpg"
- name: Generate site
run: |
npm run generate
- name: Generate XMLs
run: |
python3 .github/workflows/generate_sitemaps.py
python3 .github/workflows/generate_feeds.py
- name: Sign in
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ap-northeast-1
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Copy files to S3
run: |
aws s3 rm \
--region ap-northeast-1 \
--recursive \
--exclude "apps/*" \
--exclude "assets/components/*" \
s3://mirumime-prd-mirumi-me/
aws s3 cp \
--region ap-northeast-1 \
--recursive \
--cache-control "max-age=31536000" \
.output/public/_nuxt/ s3://mirumime-prd-mirumi-me/_nuxt/
aws s3 cp \
--region ap-northeast-1 \
--recursive \
--cache-control "no-cache" \
--exclude "_nuxt/*" \
--exclude "assets/components/*" \
.output/public/ s3://mirumime-prd-mirumi-me/
- name: Purge CDN caches
run: |
aws cloudfront create-invalidation \
--distribution-id E1UPWIMHFP5TEC \
--paths "/*" "/*/\\*"