-
Notifications
You must be signed in to change notification settings - Fork 49
48 lines (44 loc) · 1.62 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
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker compose up --build --detach ci
- name: pnpm build
run: docker compose exec --no-TTY ci pnpm build
- name: pnpm preview
run: docker compose exec --detach --no-TTY ci pnpm preview
- name: pnpm lint
run: docker compose exec --no-TTY ci pnpm lint
- name: pnpm check
run: docker compose exec --no-TTY ci pnpm check
- name: pnpm test
run: docker compose exec --no-TTY ci pnpm test
- name: pnpm e2e
run: docker compose exec --no-TTY ci pnpm e2e
deploy:
needs: test
runs-on: ubuntu-latest
if: ${{ contains(fromJSON('["refs/heads/main", "refs/heads/release", "refs/heads/prod"]'), github.ref) }}
environment: ${{ github.ref_name }}
steps:
- name: Trigger deployment
run: curl -k ${{ secrets.DEPLOY_HOOK }}
cd:
needs: test
runs-on: ubuntu-latest
if: ${{ contains(fromJSON('["refs/heads/main", "refs/heads/release", "refs/heads/prod"]'), github.ref) }}
environment: ${{ github.ref_name }}
steps:
- name: Trigger deployment
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/Shyam-Chen/Pulumi-Starter/dispatches \
-d '{ "event_type": "trigger-client-workflow", "client_payload": { "sha": "${{ github.sha }}" } }'