From e78e52e272f1850bd9eaa4bed256d57a366c67a0 Mon Sep 17 00:00:00 2001 From: ake <40662956+ake123@users.noreply.github.com> Date: Tue, 16 Jan 2024 14:34:15 +0200 Subject: [PATCH] Create deploy.yml --- .github/workflows/deploy.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..b37f5a06 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Build and Deploy React Website + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' # Use the Node.js version that matches your development environment + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Test # Optional, remove if you don't have tests + run: npm test + + # Deployment step, adjust if using a host other than GitHub Pages + - name: Deploy to GitHub Pages + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build # Adjust this path to your build directory