File tree Expand file tree Collapse file tree 4 files changed +35
-7
lines changed
Expand file tree Collapse file tree 4 files changed +35
-7
lines changed Original file line number Diff line number Diff line change 88 # Allows you to run this workflow manually from the Actions tab
99 workflow_dispatch :
1010
11- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12- permissions :
13- contents : read
14- pages : write
15- id-token : write
16-
1711# Allow one concurrent deployment
1812concurrency :
1913 group : " pages"
@@ -53,18 +47,27 @@ jobs:
5347 HUGO_ENV : production
5448 run : |
5549 hugo --minify
50+ - name : Validate page build
51+ run : |
52+ bash validate.sh
5653 - name : Upload artifact
5754 uses : actions/upload-pages-artifact@v3
5855 with :
5956 path : ./public
60-
57+
6158 # Deployment job
6259 deploy :
6360 environment :
6461 name : github-pages
6562 url : ${{ steps.deployment.outputs.page_url }}
6663 runs-on : ubuntu-latest
6764 needs : build
65+
66+ permissions : # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
67+ contents : read
68+ pages : write
69+ id-token : write
70+
6871 steps :
6972 - name : Deploy to GitHub Pages
7073 id : deployment
Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ tasks:
1919 cmds :
2020 - |
2121 {{.HUGO}} --minify {{if .TERMUX}}--noBuildLock{{end}}
22+
23+ validate :
24+ desc : Validates the page build.
25+ deps :
26+ - build
27+ cmds :
28+ - |
29+ bash validate.sh
2230
2331 new-blog :
2432 desc : Creates a new blog post.
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ set -e
23
34BASE=" assets/toots"
45
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ BASE=" public"
5+
6+ [ -d " $BASE " ] || (echo " Page build is missing, please create that first through 'task build'" && exit -1)
7+
8+ pushd $BASE
9+
10+ # Validate json files
11+ for json in $( find . -iname " *.json" -type f) ; do
12+ echo " Validating $json ..."
13+ jq . " $json " 1> /dev/null
14+ done
15+
16+ popd
You can’t perform that action at this time.
0 commit comments