Merge pull request #477 from aburd/docs/formatting #762
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: document | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
asciidoc: | |
runs-on: ubuntu-latest | |
container: | |
image: asciidoctor/docker-asciidoctor | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build html for DEV | |
if: github.ref == 'refs/heads/dev' | |
run: asciidoctor -o target/html/index.html doc/pages/index.adoc -a 'help_html=https://vim-iced-nightly.netlify.com/vim-iced.html' | |
- name: build html for PROD | |
if: github.ref == 'refs/heads/main' | |
run: asciidoctor -o target/html/index.html doc/pages/index.adoc | |
- uses: actions/upload-artifact@master | |
with: | |
name: asciidoc_index.html | |
path: target/html/index.html | |
help: | |
needs: asciidoc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build help html | |
run: bash scripts/html.sh | |
- uses: actions/download-artifact@master | |
with: | |
name: asciidoc_index.html | |
path: tmp/html | |
- name: copy index.html | |
run: cp -pf tmp/html/index.html target/html/index.html | |
- name: copy assets | |
run: cp -pr doc/pages/assets target/html/assets | |
- uses: actions/upload-artifact@master | |
with: | |
name: document | |
path: target/html | |
nightly-deploy: | |
if: github.ref == 'refs/heads/dev' | |
needs: [asciidoc, help] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@master | |
with: | |
name: document | |
path: document | |
- uses: netlify/actions/cli@master | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PERSONAL_ACCESS_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
with: | |
args: deploy --dir=document --prod | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
needs: [asciidoc, help] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@master | |
with: | |
name: document | |
path: document | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./document |