From b4f3598738bf5f2a0bb0e5a5649aeb603047bea8 Mon Sep 17 00:00:00 2001 From: Danny Coulombe Date: Fri, 2 May 2025 09:38:17 -0400 Subject: [PATCH] Deploy to pages workflow --- .github/workflows/deploy-pages.yml | 58 ++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-pages.yml diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..f99e632 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,58 @@ +name: Deploy static content to Pages + +on: + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '>=18' + + - name: Install dependencies + run: yarn + + - name: Build project + run: yarn build-only + + - name: Copy index.html to 404.html + run: cp ./dist/index.html ./dist/404.html + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/package.json b/package.json index 27121cb..41e085c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@jsonms/demo", "private": true, "type": "module", - "version": "0.1.9", + "version": "0.1.10", "scripts": { "dev": "vite", "build": "run-p type-check \"build-only {@}\" --",