-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.29 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
name: Deploy to Cloudflare
on:
push:
branches:
- main
jobs:
build-and-deploy:
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: aquaproj/aqua-installer@e6160e5a751bbcbd337a834eb75c15ba9ca206ae # v3.0.2
with:
aqua_version: v2.42.2
- name: Build
run: |
git submodule init
git submodule update
hugo
- name: Setup aws-cli for Cloudflare
run: |
echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> $GITHUB_ENV
echo "AWS_DEFAULT_REGION=auto" >> $GITHUB_ENV
echo "ENDPOINT=$ENDPOINT" >> $GITHUB_ENV
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
ENDPOINT: ${{secrets.S3_ENDPOINT}}
- name: Upload to R2
working-directory: public
run: aws s3 sync . s3://portfolio --endpoint-url $ENDPOINT
- name: Send purge request to Fastly
run: fastly purge --service-name portfolio --all
env:
FASTLY_API_TOKEN: ${{secrets.FASTLY_API_TOKEN}}