Add gh-pages build
This commit is contained in:
parent
3db9dc1173
commit
92d63bf6c2
1 changed files with 48 additions and 0 deletions
48
.github/workflows/main.yml
vendored
Normal file
48
.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: Deploy Site
|
||||
|
||||
# Controls when the workflow will run
|
||||
on:
|
||||
push:
|
||||
branches: [ master]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v3.0.0
|
||||
|
||||
# Builds the react site for github pages
|
||||
- name: Deploy GH Pages Site
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
npm i
|
||||
rm .gitignore
|
||||
webpack
|
||||
tsc
|
||||
node build/index.js generate
|
||||
rm build/index.js
|
||||
rm build/public/template.html
|
||||
mv CNAME build/public
|
||||
mv build/public docs
|
||||
echo "# DO NOT MANUALLY PUSH TO THIS BRANCH, ANY WORK DONE WILL BE ERASED. ITS WORK COMES FROM MASTER AND IT WILL BE REWRITTEN THE NEXT TIME AN ACTION OCCURS ON THE MASTER BRANCH" > README.md
|
||||
git stash
|
||||
git checkout -b page
|
||||
git stash pop
|
||||
git add .
|
||||
git commit -m "Generated React site"
|
||||
git push --set-upstream origin page --force
|
Loading…
Reference in a new issue