Skip to content

Merge pull request #350 from UBC-DSCI/fix-vc-links-3 #29

Merge pull request #350 from UBC-DSCI/fix-vc-links-3

Merge pull request #350 from UBC-DSCI/fix-vc-links-3 #29

name: Rebuild and deploy dev version of book to gh-pages branch in dev/ folder
on:
push:
branches:
- main
paths:
- 'source/**'
- 'build_html.sh'
jobs:
deploy-main-preview:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Get Actions user id
id: get_uid
run: |
actions_user_id=`id -u $USER`
echo $actions_user_id
echo "uid=$actions_user_id" >> $GITHUB_OUTPUT
- name: checkout
uses: actions/checkout@v2
with:
ref: 'main'
- name: Build the book
run: |
./build_html.sh
- name: Reset ownership of workspace after build
uses: peter-murray/reset-workspace-ownership-action@v1
with:
user_id: ${{ steps.get_uid.outputs.uid }}
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: source/_build/html
keep_files: true
destination_dir: dev
# force_orphan: true # once peaceiris updates to v4, change this to true and keep_files: true for the PR / main branch deploy previews