fix: unable to change gameconfig #49
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
# Workflow for building from testing branch to /hanabi-tracker/test and saving to gh-pages branch | |
name: Build for GitHub Pages (Testing) | |
on: | |
push: | |
branches: | |
- testing | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "build-testing" | |
cancel-in-progress: true | |
jobs: | |
build: | |
environment: | |
name: github-pages | |
url: "https://jparkhouse.github.io/hanabi-tracker/test" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: testing | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build -- --mode testing | |
- name: Debug - List Dist Contents | |
run: ls -l dist | |
- name: Save Build Output | |
run: mv dist ../dist-testing | |
- name: Discard Local Changes | |
run: git reset --hard && rm -rf | |
- name: Checkout gh-pages Branch | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git fetch origin | |
git checkout gh-pages || git checkout --orphan gh-pages | |
- name: Inject Build Output | |
run: rm -r ./test || true && mkdir -p ./test && mv ../dist-testing/* ./test/ | |
- name: Commit and Push Changes | |
# checks if there are changes, so that no changes does not result in a falsely failing build | |
run: | | |
if ! git diff --quiet FETCH_HEAD; then | |
git add . | |
git commit -m 'Deploy to GitHub Pages from testing branch' | |
git push origin gh-pages | |
else | |
echo "No changes to commit" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |