Skip to content

Deploy Website

Deploy Website #9

Workflow file for this run

name: Deploy Website
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Generate docs
working-directory: tools/docgen
run: go run . -docs ${{ github.workspace }}/web/docs
- name: Generate sitemap
working-directory: tools/sitemap
run: go run . -docs ${{ github.workspace }}/web/docs -out ${{ github.workspace }}/web/sitemap.xml
- name: Inject version into HTML
run: |
VERSION="${GITHUB_REF_NAME}"
find ./web -name '*.html' -exec sed -i "s/__VERSION__/${VERSION}/g" {} +
- name: Deploy via SFTP
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq lftp
lftp -u "${{ secrets.SFTP_USER }},${{ secrets.SFTP_PASSWORD }}" \
-p ${{ secrets.SFTP_PORT }} \
-e "set sftp:auto-confirm yes; mirror -R --verbose ./web/ ./; quit" \
sftp://${{ secrets.SFTP_HOST }}