Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
name: Deploy to Production
name: Build and Deploy

on:
push:
branches:
- main
pull_request:
branches: [main]
workflow_dispatch: {}

concurrency:
group: "deploy-production"
cancel-in-progress: true

jobs:
test:
name: Run tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

build:
name: Build and upload artifact
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -41,6 +63,8 @@ jobs:
name: Deploy to server
runs-on: ubuntu-latest
needs: build
# Only deploy from main branch
if: github.ref == 'refs/heads/main'

steps:
- name: Download build artifact
Expand Down
Loading