Publish #826
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: Publish | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 3 * * *' # Daily at 03:00 | |
concurrency: | |
# Only run once for latest commit per ref and cancel other (previous) runs. | |
group: publish-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docs: | |
name: Antora | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves | |
fetch-depth: 0 | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
run: | | |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}[email protected]@1.0.0-alpha.8 | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Antora and extensions | |
run: npm i -D -E --quiet --no-progress @antora/[email protected] @antora/[email protected] @antora/[email protected] | |
- name: Build documentation | |
run: | | |
npx antora antora-playbook-en.yml | |
npx antora antora-playbook-ru.yml | |
- name: Publish to GitHub Pages | |
if: github.event.repository.fork == false | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: build/site | |
force_orphan: true | |
cname: taymyr.io | |
commit_message: "Deploy docs" | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |