Deploy Docs #1717
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 Docs | |
on: | |
schedule: | |
- cron: "0 6 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download act3 | |
run: | | |
LATEST_VERSION=$(curl -s https://api.github.com/repos/dhth/act3/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^v//') | |
curl -s -OL https://github.com/dhth/act3/releases/download/v${LATEST_VERSION}/act3_${LATEST_VERSION}_linux_amd64.tar.gz | |
tar -xzvf act3_${LATEST_VERSION}_linux_amd64.tar.gz | |
- name: Generate GH token | |
id: generate-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.GH_TOKEN_APP_ID }} | |
private-key: ${{ secrets.GH_TOKEN_APP_PRIVATE_KEY }} | |
- name: Generate doc | |
run: | | |
./act3 \ | |
-r neovim/neovim \ | |
-f html > ./.github/static/index.html | |
env: | |
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./.github/static | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |