Deploy Website #9
Workflow file for this run
This file contains hidden or 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 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 }} |