diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..38a03bc --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,50 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main # Set this to your default branch + +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build-and-deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './dist' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 4f4cb31..bf807e7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,31 @@ -# sokoban -A simple sokoban game generated with AI +# Sokoban + +A simple Sokoban game built with Phaser 3 and Vite. + +## Description + +This is a browser-based implementation of the classic Sokoban puzzle game, built using Phaser 3 game framework and Vite as the build tool. + +## Development + +To run the development server: + +```bash +npm install +npm run dev +``` + +## Building + +To build the project for production: + +```bash +npm install +npm run build +``` + +## Deployment + +This project is automatically deployed to GitHub Pages when changes are pushed to the main branch. + +You can access the deployed game at: [https://tiennm99.github.io/sokoban/](https://tiennm99.github.io/sokoban/) diff --git a/index.html b/index.html index 408ed71..7e6ba2f 100644 --- a/index.html +++ b/index.html @@ -2,10 +2,10 @@ - + - - Phaser - Template + + Sokoban - A Phaser Game diff --git a/package.json b/package.json index 9b35256..4b6be59 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,19 @@ { - "name": "template-vite", - "description": "A Phaser 3 template using Vite.", - "version": "1.4.0", + "name": "sokoban", + "description": "A simple Sokoban game built with Phaser 3 and Vite", + "version": "1.0.0", "type": "module", "repository": { "type": "git", - "url": "git+https://github.com/phaserjs/template-vite.git" + "url": "git+https://github.com/tiennm99/sokoban.git" }, - "author": "Phaser Studio (https://phaser.io/)", + "author": "tiennm99", "license": "MIT", "licenseUrl": "http://www.opensource.org/licenses/mit-license.php", "bugs": { - "url": "https://github.com/phaserjs/template-vite/issues" + "url": "https://github.com/tiennm99/sokoban/issues" }, - "homepage": "https://github.com/phaserjs/template-vite#readme", + "homepage": "https://tiennm99.github.io/sokoban/", "scripts": { "dev": "node log.js dev & vite --config vite/config.dev.mjs", "build": "node log.js build & vite build --config vite/config.prod.mjs",