From deb40ba5a9ce0908c94e37255a00ecc5f76ad327 Mon Sep 17 00:00:00 2001 From: Raymond Wang Date: Mon, 24 Oct 2022 17:32:36 -0700 Subject: [PATCH] fix actions --- .github/workflows/main.yml | 75 +++++++++---------- .../{validation.yml => validate.yml} | 2 +- 2 files changed, 36 insertions(+), 41 deletions(-) rename .github/workflows/{validation.yml => validate.yml} (92%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4dce73..18f22b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,50 +1,45 @@ # 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 on: - push: - branches: [main] - # The below rule invokes when ANY pull request is made to main - # This is DANGEROUS and can allow for malicious behavior - # pull_request: - # branches: [main] + push: + branches: [main] + # The below rule invokes when ANY pull request is made to main + # This is DANGEROUS and can allow for malicious behavior + # pull_request: + # branches: [main] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + # 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 + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + 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 - 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 + # Builds the react site for github pages + - name: Build Static Pages + run: | + npm ci + npm run build + 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 + - name: Push to Deployment Branch + run: | + git stash + git checkout -b page + git stash pop + git add . + git commit -m "Deploy Site" + git push origin page --force diff --git a/.github/workflows/validation.yml b/.github/workflows/validate.yml similarity index 92% rename from .github/workflows/validation.yml rename to .github/workflows/validate.yml index 729868f..c168ecd 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validate.yml @@ -1,4 +1,4 @@ -name: Validation Testing +name: validate on: [push, pull_request]