mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-13 16:26:50 +00:00
51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
name: build
|
||
|
||
on:
|
||
# Run the build for pushes and pull requests targeting master
|
||
push:
|
||
branches:
|
||
- master
|
||
pull_request:
|
||
branches:
|
||
- master
|
||
# Used to trigger the build for Anchor feed updates. Can by kicked off via:
|
||
# curl -X POST -H "Authorization: token $GH_PAT" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/Einundzwanzig-Podcast/einundzwanzig.space/dispatches --data '{"event_type": "build_docs"}'
|
||
repository_dispatch:
|
||
types:
|
||
- anchor_update
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
strategy:
|
||
matrix:
|
||
node-version: [16]
|
||
steps:
|
||
# Checkout and setup
|
||
- name: Checkout
|
||
uses: actions/checkout@v2
|
||
- name: Setup (Node.js ${{ matrix.node-version }})
|
||
uses: actions/setup-node@v1
|
||
with:
|
||
node-version: ${{ matrix.node-version }}
|
||
# Install and build
|
||
- name: Install
|
||
run: npm ci
|
||
- name: Build
|
||
run: npm run prod
|
||
env:
|
||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||
# Deploy, limited to the master branch
|
||
- name: Deploy
|
||
if: success() && github.ref == 'refs/heads/master'
|
||
uses: peaceiris/actions-gh-pages@v3
|
||
with:
|
||
publish_dir: ./dist
|
||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||
cname: einundzwanzig.space
|
||
user_name: 'github-actions[bot]'
|
||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||
# Run linkcheck, propagate linkcheck failure through grep pipe
|
||
# - name: Linkcheck
|
||
# run: set -o pipefail; npm run linkcheck 2>/dev/null | grep "Getting links from\|BROKEN"
|