-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (51 loc) · 1.66 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
name: build_test_deploy
run-name: Build, test and deploy website (if needed)
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Just
uses: extractions/setup-just@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
- name: Build
run: just build
- 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: rsync deploy
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/beta
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Deploy GiutHub pages
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref == 'refs/heads/main' }} && ( success() || failure() ) # Remove the && clause when a HTML check is flawless
with:
folder: admin # The folder the action should deploy.