-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.13 KB
/
deploy.yml
File metadata and controls
38 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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@v6
- name: Set up Go
uses: actions/setup-go@v6
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 }}