-
Notifications
You must be signed in to change notification settings - Fork 50
52 lines (48 loc) · 1.25 KB
/
build.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
name: build
on:
push:
branches:
- main-staging
- main
env:
PUBLISH_DIRECTORY: public
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Checkout Staging
if: github.ref_name == 'main-staging'
uses: actions/checkout@v4
with:
ref: asf-staging
path: ${{ env.PUBLISH_DIRECTORY }}
- name: Checkout Production
if: github.ref_name == 'main'
uses: actions/checkout@v4
with:
ref: asf-site
path: ${{ env.PUBLISH_DIRECTORY }}
- name: Install Hugo
run: |
sudo apt-get update
sudo apt-get install hugo
- name: Prepare
working-directory: ${{ env.PUBLISH_DIRECTORY }}
run: |
rm -rf stylesheets
- name: Build
run: |
bash prebuild.sh
hugo
- name: Publish
working-directory: ${{ env.PUBLISH_DIRECTORY }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Published changes from $GITHUB_SHA"
git push