Update Game Data, Recompile wasm, and push to forward #215
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Game Data, Recompile wasm, and push to forward | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
update: | |
continue-on-error: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update Game Data | |
run: python data/checkUpdate.py | |
- name: Commit files | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add data -f | |
git commit -m "Update Game Data" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
recompile-ems: | |
runs-on: ubuntu-latest | |
needs: update | |
steps: | |
- uses: mymindstorm/setup-emsdk@v13 | |
with: | |
version: 3.1.47 | |
- name: version | |
run: emcc --version | |
- uses: actions/checkout@v2 | |
- run: git pull | |
- run: sed -zi 's/\n//g' data/data.min.json | |
- run: sed -zi 's/ //g' data/data.min.json | |
- name: Recompile | |
run: | | |
cd build_js | |
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release | |
emmake make | |
- name: Commit files | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add build_js | |
git commit -m "Recompile Emscripten" | |
- name: Remove CmakeFiles | |
run: | | |
rm -rf build_js/CMakeFiles | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
- name: Deploy to external repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.bcjh_web }} | |
with: | |
# GitHub Action output files | |
source-directory: build_js/ | |
destination-github-username: hjenryin | |
destination-repository-name: BCJH-Metropolis-html | |
user-email: 41898282+github-actions[bot]@users.noreply.github.com | |
# It defaults to `main` | |
target-branch: "forward-emscripten" | |
target-directory: "js/upload" | |
commit-message: ${{ github.event.head_commit.message }}. (From ${{ github.event.repository.url }}/commit/${{ github.event.head_commit.id }}) | |
push-to-debug: | |
runs-on: ubuntu-latest | |
needs: recompile-ems | |
# Makes sure that when the debug page is ready, the main page is also ready | |
if: ${{ !cancelled() }} | |
steps: | |
- uses: mymindstorm/setup-emsdk@v13 | |
with: | |
version: 3.1.56 | |
- name: version | |
run: emcc --version | |
- uses: actions/checkout@v2 | |
- run: git pull | |
- run: sed -zi 's/\n//g' data/data.min.json | |
- run: sed -zi 's/ //g' data/data.min.json | |
- name: Recompile | |
run: | | |
cd build_js | |
emcmake cmake .. -DCMAKE_BUILD_TYPE=Debug | |
emmake make | |
- name: Remove CmakeFiles | |
run: | | |
rm -rf build_js/CMakeFiles | |
- name: Deploy to external repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.bcjh_web }} | |
with: | |
# GitHub Action output files | |
source-directory: build_js/ | |
destination-github-username: hjenryin | |
destination-repository-name: BCJH-Metropolis-html | |
user-email: 41898282+github-actions[bot]@users.noreply.github.com | |
# It defaults to `main` | |
target-branch: "debug-online" | |
target-directory: "js/upload" | |
commit-message: ${{ github.event.head_commit.message }}. (From ${{ github.repository_owner }}/${{ github.repository }}@${{ github.sha }}) | |