Skip to content

React (SPA)

React (SPA) #10

name: React (SPA)
on:
# Runs on pushes targeting the default branch that's only related to the front-end folder.
push:
branches: ["master"]
paths:
- "**/*.js"
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages.
permissions:
contents: read
pages: write
id-token: write
# Allows only one deployment at a time.
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- name: Build App
run: |
npm ci --workspace front-end
npm run build --workspace front-end
- name: Setup Pages
uses: actions/configure-pages@v3
- name: List Front-end Directory
run: ls
- name: Upload Artifact
uses: actions/upload-pages-artifact@v1
with:
path: "Node+Socket.io+React/front-end/build"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2