2023-04-28 01:04:07 +09:00
|
|
|
name: Publish website
|
2023-04-28 17:29:31 +09:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-04-28 01:04:07 +09:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-10-29 19:58:54 +09:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [lts/*]
|
|
|
|
|
2023-04-28 01:04:07 +09:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-09-04 21:51:59 +09:00
|
|
|
uses: actions/checkout@v4
|
2023-04-28 18:42:19 +09:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-04-28 01:04:07 +09:00
|
|
|
|
2023-10-29 19:58:54 +09:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-10-29 04:02:51 +09:00
|
|
|
uses: actions/setup-node@v4
|
2023-04-28 01:04:07 +09:00
|
|
|
with:
|
2023-10-29 19:58:54 +09:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2023-04-28 01:04:07 +09:00
|
|
|
|
|
|
|
- name: Install Gulp
|
|
|
|
run: npm install -g gulp-cli
|
|
|
|
|
|
|
|
- name: Install other dependencies
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Build the website
|
|
|
|
run: gulp web
|
|
|
|
|
|
|
|
- name: Archive the website
|
|
|
|
shell: sh
|
|
|
|
run: |
|
|
|
|
chmod -c -R +rX "$INPUT_PATH" | while read line; do
|
|
|
|
echo "::warning title=Invalid file permissions automatically fixed::$line"
|
|
|
|
done
|
|
|
|
tar \
|
|
|
|
--dereference --hard-dereference \
|
|
|
|
--directory "$INPUT_PATH" \
|
|
|
|
-cvf "$RUNNER_TEMP/website.tar" \
|
|
|
|
--exclude=.git \
|
|
|
|
--exclude=.github \
|
|
|
|
.
|
|
|
|
env:
|
|
|
|
INPUT_PATH: build/gh-pages
|
|
|
|
|
|
|
|
- name: Upload the website
|
2023-12-25 21:11:44 +09:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-04-28 01:04:07 +09:00
|
|
|
with:
|
|
|
|
name: github-pages
|
|
|
|
path: ${{ runner.temp }}/website.tar
|
|
|
|
retention-days: 1
|
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
name: Deploy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
permissions:
|
|
|
|
pages: write # Required to deploy to GitHub Pages.
|
|
|
|
id-token: write # Required to verify that the deployment originates from this workflow.
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Deploy the website
|
2023-12-25 21:11:47 +09:00
|
|
|
uses: actions/deploy-pages@v4
|