-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.38 KB
/
publish.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
name: Publish
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Setup AWS
run: |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID \
&& aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY \
&& aws configure set region eu-central-1
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Sync with S3
run: aws s3 sync --endpoint=https://fra1.digitaloceanspaces.com s3://$S3_BUCKET_NAME _site
env:
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload artifacts
uses: actions/upload-pages-artifact@v3
with:
path: _site
- name: Deploy to S3
run: aws s3 sync --endpoint=https://fra1.digitaloceanspaces.com _site s3://$S3_BUCKET_NAME
env:
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
deploy:
runs-on: ubuntu-22.04
needs: build
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy
uses: actions/deploy-pages@v4