Skip to content

Commit

Permalink
Merge pull request #12 from DIVD-NL/build_with_just
Browse files Browse the repository at this point in the history
Inproving build process
  • Loading branch information
MrSeccubus authored Nov 29, 2023
2 parents b5c832b + 3ebb4a5 commit 43e0953
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/build_pages_native.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_test_deploy
run-name: Build, test and deploy website (if needed)
run-name: Build and test website (and deploy if needed)
on:
push:
branches:
Expand All @@ -14,26 +14,31 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
# with:
# fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
- name: Build
run: hugo --minify
# - name: "Fix security.txt"
# run: mkdir public/.well-known && (cd public/.well-known && ln -s ../security.txt) && ls -al public/.well-known
# - name: ".htaccess"
# run: cp .htaccess public/
run: |
npm install
hugo --minify
npm run postbuild
# - name: Test HTML code
# run: |
# sudo apt-get update -y
# sudo apt-get install python3-pip libcurl4 -y
# pip3 install html5validator
# sudo gem install --no-document html-proofer
# ./proof_html.sh || exit 0
# 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' }}
if: ${{ github.ref == 'refs/heads/main' }} # && ( success() || failure() ) # Remove the && clause when a HTML check is flawless
with:
switches: -avzr --delete
path: public/
Expand All @@ -43,6 +48,6 @@ jobs:
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Deploy GiutHub pages
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref == 'refs/heads/main' }}
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.
6 changes: 6 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ build:
hugo --minify
npm run postbuild

serve:
npm install
echo "Server will be running on http://0.0.0.0:1313"
hugo server
npm run postbuild

admin:
npx netlify-cms-proxy-server &
python3 -m http.server --directory ./admin &
Expand Down

0 comments on commit 43e0953

Please sign in to comment.