Skip to content

Commit

Permalink
Create build and deploy workflow using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Davis committed Jan 6, 2024
1 parent 4f1b18f commit 2c693be
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: build and deploy

on:
push:
branches: ["main"]

env:
NODE_VERSION: 20

jobs:
build:
name: build

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install
- run: npm run build:production
- name: Copy static files
run: cp -r ./public/. ./dist
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
needs: build

name: deploy

runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 2c693be

Please sign in to comment.