fix actions
This commit is contained in:
parent
bf4a321f22
commit
deb40ba5a9
2 changed files with 36 additions and 41 deletions
75
.github/workflows/main.yml
vendored
75
.github/workflows/main.yml
vendored
|
@ -1,50 +1,45 @@
|
||||||
# This is a basic workflow to help you get started with Actions
|
# This is a basic workflow to help you get started with Actions
|
||||||
|
|
||||||
name: Deploy Site
|
name: build-page-branch
|
||||||
|
|
||||||
# Controls when the workflow will run
|
# Controls when the workflow will run
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
# The below rule invokes when ANY pull request is made to main
|
# The below rule invokes when ANY pull request is made to main
|
||||||
# This is DANGEROUS and can allow for malicious behavior
|
# This is DANGEROUS and can allow for malicious behavior
|
||||||
# pull_request:
|
# pull_request:
|
||||||
# branches: [main]
|
# branches: [main]
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
jobs:
|
jobs:
|
||||||
# This workflow contains a single job called "build"
|
# This workflow contains a single job called "build"
|
||||||
build:
|
build:
|
||||||
# The type of runner that the job will run on
|
# The type of runner that the job will run on
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Use production environment specified in GitHub settings
|
||||||
|
environment: production
|
||||||
|
# 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
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Builds the react site for github pages
|
||||||
steps:
|
- name: Build Static Pages
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
run: |
|
||||||
- uses: actions/checkout@v2
|
npm ci
|
||||||
- uses: actions/setup-node@v3.0.0
|
npm run build
|
||||||
|
mv build/public docs
|
||||||
# Builds the react site for github pages
|
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
|
||||||
- name: Deploy GH Pages Site
|
- name: Push to Deployment Branch
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'github-actions[bot]'
|
git stash
|
||||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
git checkout -b page
|
||||||
npm i
|
git stash pop
|
||||||
rm .gitignore
|
git add .
|
||||||
webpack
|
git commit -m "Deploy Site"
|
||||||
tsc
|
git push origin page --force
|
||||||
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
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
name: Validation Testing
|
name: validate
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
Loading…
Reference in a new issue