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

Commit

Permalink
ci: deploy to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
smarlhens committed Dec 8, 2023
1 parent 45370a9 commit c81e354
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: deploy

on:
workflow_dispatch: {}
push:
branches:
- main

env:
NODE_VERSION: '18.12.0'

jobs:
deploy:
runs-on: ubuntu-22.04

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

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

steps:
- uses: actions/checkout@v4

- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm ci

- name: Prettier
run: npm run prettier:check

- name: Build
run: npm run build -- --base /my-css-journey/

- uses: actions/configure-pages@v3

- uses: actions/upload-pages-artifact@v1
with:
path: dist

- name: Deploy
id: deployment
uses: actions/deploy-pages@v2
31 changes: 31 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: pr

on:
pull_request:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node: ['18.12.0', '20.0.0']

steps:
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Prettier
run: npm run prettier:check

0 comments on commit c81e354

Please sign in to comment.