-
Notifications
You must be signed in to change notification settings - Fork 5
77 lines (76 loc) · 2.76 KB
/
build_pages_native.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: build_test_deploy
run-name: Build and test website (and deploy if needed)
on:
push:
branches:
- main
- staging
pull_request:
branches:
- main
- staging
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.139.4' # See https://github.com/gohugoio/hugo/issues/13150
extended: true
- name: Build
run: |
npm install
npm run gen-people
npm run gen-teams
npm run update-stats
npm run cms-build
hugo --minify
npm run postbuild
# - name: Test HTML code
# uses: Cyb3r-Jak3/[email protected]
# with:
# root: public
# - name: Upload HTML test report
# uses: actions/upload-artifact@v3
# if: success() || failure() # Run even if we had an error
# with:
# name: html5validator_log
# path: log.log
- name: Modify .htacess for staging
if: ${{ github.ref == 'refs/heads/staging' }}
run: |
sed -i 's#www\.divd#staging.divd#' public/.htaccess
sed -i 's#\-2024#-staging#g' public/.htaccess
- name: rsync deploy staging
uses: burnett01/[email protected]
if: ${{ github.ref == 'refs/heads/staging' }} # && ( success() || failure() ) # Remove the && clause when a HTML check is flawless
with:
switches: -avzr --delete
path: public/
remote_path: htdocs/divd-nl-staging
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: rsync deploy production
uses: burnett01/[email protected]
if: ${{ github.ref == 'refs/heads/main' }} # && ( success() || failure() ) # Remove the && clause when a HTML check is flawless
with:
switches: -avzr --delete
path: public/
remote_path: htdocs/divd-nl-2024
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Deploy GitHub pages
uses: JamesIves/github-pages-deploy-action@v4
if: ( ${{ github.ref == 'refs/heads/main' }} || ${{ github.ref == 'refs/heads/staging' }} ) # && ( success() || failure() ) # Remove the && clause when a HTML check is flawless
with:
folder: admin # The folder the action should deploy.