This repository has been archived by the owner on Feb 1, 2025. It is now read-only.
Done? #38
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: Deploy Hugo Site | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# This assumes that both hugo and lininator are already installed on the target machine | |
- name: Deploy to Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.NEW_SERVER_HOST }} | |
username: ${{ secrets.DOCS_USER }} | |
key: ${{ secrets.DOCS_PRIVATE_KEY }} | |
script: | | |
cd /home/${{ secrets.DOCS_USER }}/key.trueblocks.io | |
git checkout main | |
git pull | |
npm install postcss-cli | |
npm run build | |
chown -R ${{ secrets.DOCS_USER }}:${{ secrets.DOCS_USER }} . | |
chmod 644 /var/www/key.trueblocks.io/html/service-worker.js | |
cp -pR public/* /var/www/key.trueblocks.io/html/ | |
echo "Running lininator..." | |
cd /var/www/key.trueblocks.io/html/ | |
linkinator -r index.html | |
- name: Check for failure and report to Discord | |
uses: rjstone/discord-webhook-notify@v1 | |
if: failure() | |
with: | |
severity: error | |
details: Test Failed! | |
webhookUrl: ${{ secrets.DOC_WEBHOOK }} | |
- name: Report job status | |
run: | | |
echo "This job's status is ${{ job.status }}" | |