From 9b7618a4da6c4a4f85625230bdbd14e08a9f1927 Mon Sep 17 00:00:00 2001 From: Harpo Date: Sun, 7 Jan 2024 17:36:11 -0800 Subject: [PATCH] Adds action to build and deploy to pages --- .github/workflows/deploy.yml | 30 ++++++++++++++++++++++++++++++ package.json | 5 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0be7498 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,30 @@ +name: 🏭 Build and Deploy +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +permissions: + contents: write + +jobs: + build-and-deploy: + concurrency: ci-${{ github.ref }} + runs-on: ubuntu-latest + steps: + - name: 🛎️ Checkout + uses: actions/checkout@v4 + + - name: 🛠️ Install and Build + run: | + npm ci + npm run ci + + - name: 🚀 Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build diff --git a/package.json b/package.json index fe491e9..b68e5cd 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "version": "0.1.1", "description": "Chess on a Launchpad", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "parcel build --no-cache --dist-dir dist src/index.html", + "ci": "parcel build --no-cache --dist-dir build src/index.html", + "dev": "parcel --port 5555 --no-cache --dist-dir dist src/index.html" }, "browserslist": [ "defaults"