Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Github workflows (CI og Pages)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKnarf committed Sep 3, 2024
1 parent 537cd2d commit 6905b5b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/actions/install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'pnpm install'
description: 'Doing installs'
runs:
using: 'composite'
steps:
- name: 'Setting up Node'
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'

# Should pick pnpm verison based on `.packageManager` in package.json
- uses: pnpm/action-setup@v4

- name: Install dependencies
shell: bash
run: pnpm install
39 changes: 39 additions & 0 deletions .github/workflows/cd-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CD Github Pages

on:
push:
branches:
- main

jobs:
deploy-github-pages:
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: 'Checking Out Code'
uses: actions/checkout@v4

- name: 'Installing Dependencies'
uses: ./.github/actions/install

- name: 'Build'
run: pnpm --filter "capra-fagradar" build

- name: 'upload'
uses: actions/upload-pages-artifact@v3
with:
path: ./capra-fagradar/dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: 'Tests'
runs-on: ubuntu-latest
steps:
- name: 'Checking Out Code'
uses: actions/checkout@v4

- name: 'Installing Dependencies'
uses: ./.github/actions/install

- name: 'Running Unit Tests'
run: pnpm --filter "capra-fagradar" test

build:
name: 'Builds'
runs-on: ubuntu-latest
steps:
- name: 'Checking Out Code'
uses: actions/checkout@v4

- name: 'Installing Dependencies'
uses: ./.github/actions/install

- name: 'Building'
run: pnpm --filter "capra-fagradar" build
1 change: 1 addition & 0 deletions capra-fagradar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview",
"test": "echo 'no test'",
"typecheck": "tsc -b"
},
"dependencies": {
Expand Down

0 comments on commit 6905b5b

Please sign in to comment.