Skip to content

Deploy to GitHub Pages Workflow #5

Deploy to GitHub Pages Workflow

Deploy to GitHub Pages Workflow #5

Workflow file for this run

name: Deploy to GitHub Pages
on:
pull_request:
types:
- closed
branches:
- 'main'
- 'gh-pages'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
test:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci
- name: Build project
env:
CI: true
REACT_APP_CLIENT_ID: ${{ secrets.API_CLIENT_ID }}
run: npx --no-install npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./build
# Deployment job
deploy:
environment:
name: github-pages
url: https://kelseymorsebrown.github.io/jammming/
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4