Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to push on pages #3

Merged
merged 1 commit into from
Mar 29, 2024
Merged
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
66 changes: 66 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CI: false

jobs:
build:

runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
contents: 'read'
id-token: 'write'
pages: 'write'
actions: 'write'
checks: 'write'
deployments: 'write'
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
working-directory: ./web
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
working-directory: ./web
# Using npm ci is generally faster than running npm i because it caches dependencies
run: |
npm ci
- name: Build the app
working-directory: ./web
run: |
npm run build
- name: Run component tests
working-directory: ./web
run: |
npm run test

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
working-directory: ./web
uses: actions/upload-pages-artifact@v1
with:
# Upload build directory content
path: 'build/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}