From ceb600f3b0dd6ca05f70cd6445ecb175313b5802 Mon Sep 17 00:00:00 2001 From: maui Date: Wed, 26 Feb 2025 21:57:31 +0100 Subject: [PATCH] Deploy to gh pages --- .github/workflows/deploy.yml | 49 ++++++++++++++++++++++++++++++++++++ .nvmrc | 2 +- README.md | 3 +-- netlify.toml | 21 ---------------- 4 files changed, 51 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 netlify.toml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..394e870b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,49 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build --if-present + + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: dist + + deploy: + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.nvmrc b/.nvmrc index fa69d015..2bd5a0a9 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.8 +22 diff --git a/README.md b/README.md index 3637261c..0400a420 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Werewolf Card Dealer -[![Netlify Status](https://api.netlify.com/api/v1/badges/71200d24-eda9-4bd5-bc5e-ec9b4ec6b36c/deploy-status)](https://app.netlify.com/sites/werewolf-assistant/deploys) - 🃏 PWA to deal werewolf cards Use it here: @@ -9,6 +7,7 @@ Use it here: This web app lets friends play a custom version of the werewolf game without the need of cards. Main features: + - Saves progress if closed. - Responsive design (mobile, tablet and desktop). - Consistent design. diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index d5d1a10b..00000000 --- a/netlify.toml +++ /dev/null @@ -1,21 +0,0 @@ -[build] - publish = "dist" - command = "npm run build" - -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 - -[[headers]] - for = "/manifest.webmanifest" - [headers.values] - Content-Type = "application/manifest+json" - -[[headers]] - for = "/assets/*" - [headers.values] - cache-control = ''' - max-age=31536000, - immutable - '''