Skip to content

Scheduled weekly dependency update for week 45 (#373) #84

Scheduled weekly dependency update for week 45 (#373)

Scheduled weekly dependency update for week 45 (#373) #84

Workflow file for this run

# This GitHub workflow runs only on push to master.
# By this point, we are assuming that all checks on the PR,
# which are checked by the Azure Pipeline, have passed.
# The full pipeline is also leveraged here,
# as we don't want a broken website to be deployed anyways.
name: Master branch deploy
on:
push:
branches:
- master
jobs:
build-environment:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# See: https://github.com/marketplace/actions/setup-conda
- uses: s-weigand/setup-conda@v1
with:
conda-channels: "conda-forge"
# Build cache of environment
- name: Cache conda environment
id: cache-environment
uses: actions/cache@v3
# Conda environment build step depends on two files,
# so we ensure that the hash key contains both their hashes.
with:
path: |
nams.tar.gz
key: ${{ runner.os }}-${{ hashFiles('environment.yml') }}-${{ hashFiles('scripts/ci/build_environment.sh') }}-env
- name: Build environment
if: steps.cache-environment.outputs.cache-hit != 'true'
run: bash scripts/ci/build_environment.sh
# See: https://github.com/actions/upload-artifact
- name: Upload environment
uses: actions/upload-artifact@v3
with:
name: nams-tarball
path: nams.tar.gz
build-deploy-website:
runs-on: ubuntu-22.04
needs: build-environment
steps:
- uses: actions/checkout@v3
# https://github.com/actions/download-artifact
- name: Download environment tarball
uses: actions/download-artifact@v3
with:
name: nams-tarball
- name: Unpack environment and activate it
run: bash scripts/ci/unpack_environment.sh
- name: Build website
run: |
bash scripts/ci/build_website.sh
- name: Deploy Website
uses: peaceiris/actions-gh-pages@v3
with:
# https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
personal_token: ${{ secrets.GHPAGES_TOKEN }}
publish_dir: ./site
publish_branch: gh-pages
allow_empty_commit: false
keep_files: false
force_orphan: true
enable_jekyll: false
disable_nojekyll: false
build-deploy-leanpub:
runs-on: ubuntu-22.04
needs: build-environment
steps:
- uses: actions/checkout@v3
- name: Download environment tarball
uses: actions/download-artifact@v3
with:
name: nams-tarball
- name: Unpack environment and activate it
run: bash scripts/ci/unpack_environment.sh
- name: Build leanpub manuscript files
run: |
bash scripts/ci/build_leanpub.sh
- name: Deploy Leanpub
uses: peaceiris/actions-gh-pages@v3
with:
# https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
personal_token: ${{ secrets.GHPAGES_TOKEN }}
publish_dir: ./manuscript
publish_branch: leanpub
destination_dir: manuscript
allow_empty_commit: false
keep_files: false
force_orphan: true
enable_jekyll: false
disable_nojekyll: false
- name: Trigger publish on LeanPub
run: curl -d "api_key=${{ secrets.LEANPUB_API_KEY }}" https://leanpub.com/nams/publish.json