Auto Deploy to GitHub Pages #11750
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: Auto Deploy to GitHub Pages | |
on: | |
schedule: | |
# Every half hour, at minute 5, and 35 | |
- cron: "5,35 * * * *" | |
push: | |
branches: | |
- main | |
jobs: | |
test_on_push: | |
name: Build and test | |
runs-on: self-hosted | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: Install dependencies | |
run: just _install --frozen-lockfile | |
- name: Build website | |
run: just build | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
NOTION_DOCUMENT_ROOT: ${{ secrets.NOTION_DOCUMENT_ROOT }} | |
NOTION_BLOG_ROOT: ${{ secrets.NOTION_BLOG_ROOT }} | |
# Popular action to deploy to GitHub Pages: | |
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# Build output to publish to the `gh-pages` branch: | |
publish_dir: ./build | |
# The following lines assign commit authorship to the official | |
# GH-Actions bot for deploys to `gh-pages` branch: | |
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | |
# The GH actions bot is used by default if you didn't specify the two fields. | |
# You can swap them out with your own user credentials. | |
user_name: github-actions[bot] | |
user_email: 41898282+github-actions[bot]@users.noreply.github.com | |
- name: Report Status | |
if: always() | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notify_when: 'failure' | |
notification_title: '{workflow} has {status_message}' | |
footer: 'Linked to Repo <{repo_url}|{repo}>' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} | |
# name: Auto Deploy to GitHub Pages | |
# on: | |
# schedule: | |
# # Every hour, at minute 30 | |
# - cron: "30 * * * *" | |
# push: | |
# branches: | |
# - main | |
# jobs: | |
# deploy: | |
# name: Deploy to GitHub Pages | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 0 | |
# - uses: extractions/setup-just@v1 | |
# with: | |
# just-version: '1.25.2' | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - uses: actions/setup-node@v3 | |
# with: | |
# node-version: 20.x | |
# - uses: denoland/setup-deno@v1 | |
# with: | |
# deno-version: "1.44.0" | |
# - uses: pnpm/action-setup@v4 | |
# with: | |
# version: "8.15.5" | |
# - name: Install dependencies | |
# run: just _install --frozen-lockfile | |
# - name: Build website | |
# run: just build | |
# env: | |
# NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
# NOTION_DOCUMENT_ROOT: ${{ secrets.NOTION_DOCUMENT_ROOT }} | |
# NOTION_BLOG_ROOT: ${{ secrets.NOTION_BLOG_ROOT }} | |
# # Popular action to deploy to GitHub Pages: | |
# # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | |
# - name: Deploy to GitHub Pages | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# # Build output to publish to the `gh-pages` branch: | |
# publish_dir: ./build | |
# # The following lines assign commit authorship to the official | |
# # GH-Actions bot for deploys to `gh-pages` branch: | |
# # https://github.com/actions/checkout/issues/13#issuecomment-724415212 | |
# # The GH actions bot is used by default if you didn't specify the two fields. | |
# # You can swap them out with your own user credentials. | |
# user_name: github-actions[bot] | |
# user_email: 41898282+github-actions[bot]@users.noreply.github.com | |
# - name: Report Status | |
# if: always() | |
# uses: ravsamhq/notify-slack-action@v1 | |
# with: | |
# status: ${{ job.status }} | |
# notify_when: 'failure' | |
# notification_title: '{workflow} has {status_message}' | |
# footer: 'Linked to Repo <{repo_url}|{repo}>' | |
# env: | |
# SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |