Skip to content

fix: Possible fix for reverting gameState, possibly breaks something … #61

fix: Possible fix for reverting gameState, possibly breaks something …

fix: Possible fix for reverting gameState, possibly breaks something … #61

Workflow file for this run

name: Deploy
on:
push:
branches:
- stable
- dev
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Build project
env:
VITE_GAME_BUILD_VERSION: v${{ steps.version.outputs.version }}+build.${{ github.run_number }}
run: |
if [ "${{ github.ref }}" = "refs/heads/stable" ]; then
npm run build # Production build for stable
else
npm run build:dev # Dev build for dev branch
fi
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-files
path: ./dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-files
path: ./dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: ${{ github.ref == 'refs/heads/stable' && '' || 'beta' }}
keep_files: ${{ github.ref == 'refs/heads/stable' && true || false }}
release:
name: Create Release
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-files
path: ./dist
- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}+build.${{ github.run_number }}
release_name: Release v${{ steps.version.outputs.version }} (Build ${{ github.run_number }})
draft: false
prerelease: ${{ github.ref == 'refs/heads/dev' }}
generate_release_notes: true
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist
asset_name: build-files
asset_content_type: application/zip