File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,18 +22,27 @@ jobs:
2222 - run : npm ci
2323 - run : npm run build --if-present
2424
25- - name : Push build folder to `build` branch
25+ - name : Preserve build output when moving branches
26+ run : mv build ../build-tmp
27+
28+ - name : Switch to the build branch and clean it
29+ run : |
30+ # Based off the script `./scripts/deploy_to_branch.sh`
31+ # The branch we are publishing to
32+ git fetch origin build
33+ git switch build
34+ rm -rf *
35+
36+ - name : Copy the built files over to the root directory and push to `build`
2637 run : |
2738 # Set up a dummy user and email for identification purposes
39+ cp -R ../build-tmp/* .
40+ rm -f ./js/*.LICENSE.txt
41+
42+ - name : Commit and push
43+ run : |
2844 git config --global user.name "${{ github.actor }}"
2945 git config --global user.email "${{ github.actor }}@user.noreply.github.com"
30-
31- # Checkout `build` and copy the files over
32- # Based off the script `./scripts/deploy_to_branch.sh`
33- git checkout build
34- git pull origin build
35- cp -R build/* .
36- rm -f js/*.LICENSE.txt
3746 git add .
3847 git commit -m "Updating `build` with PR#${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
3948 git push origin build
Original file line number Diff line number Diff line change 1- name : Builds and pushes the results to the `test` branch when a pull request is merged nto `develop`
1+ name : Builds and pushes the results to the `test` branch when a pull request is merged into `develop`
22
33on :
44 pull_request :
@@ -22,18 +22,27 @@ jobs:
2222 - run : npm ci
2323 - run : npm run build --if-present
2424
25- - name : Push build folder to `test` branch
25+ - name : Preserve build output when moving branches
26+ run : mv build ../build-tmp
27+
28+ - name : Switch to the build branch and clean it
29+ run : |
30+ # Based off the script `./scripts/deploy_to_branch.sh`
31+ # The branch we are publishing to
32+ git fetch origin test
33+ git switch test
34+ rm -rf *
35+
36+ - name : Copy the built files over to the root directory and push to `test`
2637 run : |
2738 # Set up a dummy user and email for identification purposes
39+ cp -R ../build-tmp/* .
40+ rm -f ./js/*.LICENSE.txt
41+
42+ - name : Commit and push
43+ run : |
2844 git config --global user.name "${{ github.actor }}"
2945 git config --global user.email "${{ github.actor }}@user.noreply.github.com"
30-
31- # Checkout `build` and copy the files over
32- # Based off the script `./scripts/deploy_to_branch.sh`
33- git checkout test
34- git pull origin test
35- cp -R build/* .
36- rm -f js/*.LICENSE.txt
3746 git add .
3847 git commit -m "Updating `test` with PR#${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
3948 git push origin test
You can’t perform that action at this time.
0 commit comments