sapling/.github/workflows/sapling-website-deploy.yml
Zhaolong Zhu 3e2409653a website: trigger the website action every work day
Summary:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onschedule

We don't need to run webiste workflow on every pushes or prs, but we do need to make sure it works, so let trigger it on every work day

Reviewed By: sggutier

Differential Revision: D51306012

fbshipit-source-id: 8c1425133fbf99c6b62ed37a1daa2a383a246b29
2023-11-14 09:03:08 -08:00

58 lines
1.8 KiB
YAML

name: Publish https://sapling-scm.com
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1-5'
jobs:
deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: ./website
- name: Install dependencies
run: yarn install --frozen-lockfile
# Note this will use whichever release is tagged "Latest."
# Ultimately, this website deployment job should:
# - For a release, it should depend on the binaries being published and
# run afterwards with the new version.
# - For a pull request, `sl` built from the code that is out for review.
- name: Download latest Sapling release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ${{ format('gh release download --pattern \*.Ubuntu22.04.deb --repo {0}', github.repository) }}
- name: Install Sapling
run: sudo apt install -y ./*.Ubuntu22.04.deb
- name: Write out release data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ${{ format('./scripts/gen_release_data.py --repo {0} --out ./src/rawReleaseData.ts', github.repository) }}
- name: Generate docstring docs
run: ./scripts/generate-command-markdown.py --full-build
- name: Build website
run: yarn build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build