From 9d4edf7bcb13fd00baa175b214fc24f669b140d8 Mon Sep 17 00:00:00 2001 From: Robbo-lab Date: Wed, 16 Oct 2024 13:00:44 +0800 Subject: [PATCH] feat: github deployment workflow --- .github/workflows/deploy.yml | 31 +++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 33 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..6a28c09 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: Build the React app + run: npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build diff --git a/package.json b/package.json index b5a6312..0b10d4e 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,9 @@ "build": "webpack --mode production" }, "keywords": [], - "author": "", + "author": "John Robertson", "license": "ISC", + "homepage": "https://github.com/Robbo-lab/dip-web-app-react-app-final", "dependencies": { "bulma": "^1.0.2", "css-loader": "^7.1.2",