Build, test and deploy website (if needed) #92
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |