-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (45 loc) · 1.34 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CI
on:
push:
branches: ["main", "prod"]
pull_request:
types: [opened, synchronize]
jobs:
build:
name: Lint, build and Test
timeout-minutes: 15
runs-on: ubuntu-latest
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
NEXTAUTH_SECRET: ${{ vars.NEXTAUTH_SECRET }}
NEXT_PUBLIC_STRAPI_URL: ${{ secrets.NEXT_PUBLIC_STRAPI_URL }}
STRAPI_TOKEN: ${{ secrets.STRAPI_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20.14.0
- uses: pnpm/action-setup@v4.0.0
with:
version: 9.1.4
- name: Install dependencies
run: pnpm install
- name: Prettier
run: pnpm run prettier
- name: Lint
run: pnpm run lint
- name: Build
run: pnpm run build
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod'
env:
SCALINGO_APP_NAME: ${{ github.ref == 'refs/heads/prod' && vars.SCALINGO_PROD_APP_NAME || vars.SCALINGO_STAGING_APP_NAME }}
steps:
- uses: actions/checkout@v4
- uses: kolok/deploy-to-scalingo@v1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
known-host: ssh.osc-fr1.scalingo.com
app-name: ${{ env.SCALINGO_APP_NAME }}