pbw-explore/.github/workflows/gh-pages.yml

46 řádky
1.2 KiB
YAML
Surový Normální zobrazení Historie

2023-01-24 02:20:11 +01:00
name: GitHub Pages
on:
push:
branches:
2023-01-30 04:04:13 +01:00
- main # Set a branch name to trigger deployment
repository_dispatch:
2023-01-24 02:20:11 +01:00
jobs:
2023-02-10 11:57:19 +01:00
build_and_deploy:
2023-01-24 02:20:11 +01:00
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
with:
2023-01-30 04:04:13 +01:00
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
2023-01-24 02:20:11 +01:00
- uses: actions/setup-node@v3
with:
2023-02-05 16:27:14 +01:00
node-version: 19
2023-01-24 02:20:11 +01:00
- name: Install dependencies
run: npm ci
2023-01-24 04:59:17 +01:00
- run: rm src/lib/data.json && wget -O src/lib/data.json https://data.prgblockweek.com/23/index.json
2023-01-24 04:56:27 +01:00
2023-01-24 02:20:11 +01:00
- name: Build
run: npm run build
2023-01-30 04:04:13 +01:00
2023-01-24 02:20:11 +01:00
- name: Add custom domain
2023-01-30 04:04:13 +01:00
run: 'touch build/CNAME && echo "explore.prgblockweek.com" >> build/CNAME'
2023-01-24 02:20:11 +01:00
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
# If you're changing the branch from main,
# also change the `main` in `refs/heads/main`
# below accordingly.
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build