Skip to content

CI

CI #135

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
build-pr:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: |
npm ci
npm run test:ci
npm run lint
npm run format
mkdir -p dist
npx tsx src/main.ts "$(cat calendars.json)" > dist/calendar.ics
build:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: github-pages
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: |
npm ci
npm run test:ci
npm run lint
npm run format
mkdir -p dist
npx tsx src/main.ts "$(cat calendars.json)" > dist/calendar.ics
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'dist'
deploy:
if: github.ref == 'refs/heads/main'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2