Skip to content

Commit

Permalink
ci: Add ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolobok12309 committed Feb 29, 2024
1 parent 7660252 commit e11865e
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

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

on:
workflow_dispatch:

push:
branches: [master]

pull_request:
branches: [master]

jobs:
build:
name: Build app
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: '18'
cache: 'pnpm'

- name: Setup turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@v1

- name: Install dependencies
run: pnpm install

- name: Build app
run: turbo run build

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: .output/public

lint:
name: Lint code
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: '18'
cache: 'pnpm'

- name: Setup turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@v1

- name: Install dependencies
run: pnpm install

- name: Build app
run: turbo run lint

deploy:
needs: [build, lint]
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to Github Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: dist

0 comments on commit e11865e

Please sign in to comment.