-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.62 KB
/
pipeline.yml
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
52
53
name: PR Tests
on:
pull_request:
branches:
- develop
workflow_dispatch:
jobs:
dev:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Set up environment variables
run: |
echo "VITE_SUPABAE_URL=${{ secrets.SUPABASE_URL }}" >> $GITHUB_ENV
echo "VITE_SUPABASE_ANON_KEY=${{ secrets.SUPABASE_KEY }}" >> $GITHUB_ENV
- name: Run test
continue-on-error: true # run other jobs even if this job fails
id: test-run
run: npm run test:unit
- name: Upload test report
if: failure() && steps.test-run.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: test-report
path: test.json
uat:
needs: [dev]
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Set up UAT environment variables
run: |
echo "VITE_SUPABAE_URL=${{ secrets.UAT_SUPABASE_URL }}" >> $GITHUB_ENV
echo "VITE_SUPABASE_ANON_KEY=${{ secrets.UAT_SUPABASE_KEY }}" >> $GITHUB_ENV
- name: Deploy to UAT
run: echo "Deploying to UAT"
deploy:
needs: [uat]
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Get code
uses: actions/checkout@v3
- name: Set up production environment variables
run: |
echo "VITE_SUPABAE_URL=${{ secrets.PROD_SUPABASE_URL }}" >> $GITHUB_ENV
echo "VITE_SUPABASE_ANON_KEY=${{ secrets.PROD_SUPABASE_KEY }}" >> $GITHUB_ENV
- name: Deploy to Netlify
run: echo "Deploying to Netlify"