Skip to content

Commit

Permalink
CI/CD: upgrade build action
Browse files Browse the repository at this point in the history
  • Loading branch information
prncss-xyz committed Sep 14, 2024
1 parent b4f05bf commit b9ff26c
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Build"
description: "Sets up the repository"
runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Set up Node
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
node-version: 22
cache: "pnpm"
- name: Install dependencies
shell: sh
run: pnpm install
39 changes: 39 additions & 0 deletions .github/workflows/page.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy Pages
on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: "pages"
cancel-in-progress: true

permissions:
contents: read
pages: write
id-token: write

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
- name: Perpare
run: pnpm run build:web
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

31 changes: 31 additions & 0 deletions .github/workflows/playwright.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Playwright Tests
on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: "tests:e2e"
cancel-in-progress: true

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

23 changes: 23 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: "tests:unit"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
- name: Run tests
run: pnpm test:unit

0 comments on commit b9ff26c

Please sign in to comment.