Skip to content

Merge remote-tracking branch 'upstream/main' #4

Merge remote-tracking branch 'upstream/main'

Merge remote-tracking branch 'upstream/main' #4

name: Genarate static mainpage
on:
workflow_dispatch: {}
push:
branches:
- main
- dev
paths:
- mainpage/**
- .github/workflows/generate-mainpage.yml
env:
TZ: Asia/Shanghai
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'SubConv/SubConv'
defaults:
run:
working-directory: mainpage
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.15.0
- name: Install Dependencies
run: yarn
- name: Build
run: yarn run build
- name: move to static
run: |
pwd
if [ ! -d "../static" ]; then
mkdir -p ../static
else
rm -rf ../static/*
fi
mv dist/* ../static
git config --global user.name 'GitHub Actions'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add -A
git commit -am "update static" && git push || echo "No changes to commit"