This repository has been archived by the owner on Feb 1, 2025. It is now read-only.
Merge pull request #5 from TrueBlocks/docs/tb_status #45
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 | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # we need this because Hugo is configured with enableGitInfo = true | |
# This assumes that both hugo and lininator are already installed on the target machine | |
- name: Deploy to new server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.NEW_SERVER_HOST }} | |
username: ${{ secrets.DOCS_USER }} | |
key: ${{ secrets.DOCS_PRIVATE_KEY }} | |
script: | | |
export PATH=$PATH:/usr/local/go/bin | |
env | grep -w PATH | |
cd /home/${{ secrets.DOCS_USER }}/key.trueblocks.io | |
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 }}" | |