-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (52 loc) · 1.61 KB
/
main.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
name: Build Hugo
on:
push:
branches:
- main
- develop
- feature/github-actions
- '*'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install postcss
run: npm install postcss-cli
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.136.2'
extended: true
- name: Build
run: hugo --minify --buildDrafts=true
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Upload to S3
uses: actions/upload-artifact@v4
with:
name: build
path: public
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-central-1' # optional: defaults to us-east-1
SOURCE_DIR: 'public' # optional: defaults to entire repository
- name: Deploy to GH Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public