-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (79 loc) · 2.86 KB
/
validation-pr.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: "Validation PR"
on:
pull_request:
types:
- opened
- ready_for_review
- review_requested
- synchronize
concurrency:
group: review-app-${{ github.event.number }}
cancel-in-progress: true
jobs:
fullcheck:
uses: ./.github/workflows/fullcheck.yml
secrets:
API_KEY_OPEN_CAGE_DATA_GEOCODING: ${{ secrets.API_KEY_OPEN_CAGE_DATA_GEOCODING }}
API_KEY_OPEN_CAGE_DATA_GEOSEARCH: ${{ secrets.API_KEY_OPEN_CAGE_DATA_GEOSEARCH }}
IC_ADMIN_PASSWORD: ${{ secrets.IC_ADMIN_PASSWORD }}
IC_PASSWORD: ${{ secrets.IC_PASSWORD }}
IC_USERNAME: ${{ secrets.IC_USERNAME }}
SIRENE_INSEE_CLIENT_ID: ${{ secrets.SIRENE_INSEE_CLIENT_ID }}
SIRENE_INSEE_CLIENT_SECRET: ${{ secrets.SIRENE_INSEE_CLIENT_SECRET }}
SIRENE_INSEE_USERNAME: ${{ secrets.SIRENE_INSEE_USERNAME }}
SIRENE_INSEE_PASSWORD: ${{ secrets.SIRENE_INSEE_PASSWORD }}
INCLUSION_CONNECT_CLIENT_SECRET: ${{ secrets.INCLUSION_CONNECT_CLIENT_SECRET }}
verify-migration-order:
name: "Verify migration order"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9.4.0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.15.0"
cache: "pnpm"
- run: |
pnpm back verify-migrations-order
deploy-review-app:
if: github.event.pull_request.draft == false && github.event.pull_request.state == 'open'
uses: ./.github/workflows/review-app-deploy.yml
with:
pull_request_id: ${{ github.event.number }}
run_number: ${{ github.run_number }}
secrets:
SCALINGO_API_TOKEN: ${{ secrets.SCALINGO_API_TOKEN }}
run-seeds:
needs: deploy-review-app
runs-on: ubuntu-latest
environment: review-app
steps:
- name: Install scalingo CLI
run: |
wget -qO- https://cli-dl.scalingo.com/install.sh | bash
echo "$HOME/bin" >> $GITHUB_PATH
- name: Login to scalingo
run: scalingo login --api-token ${{ secrets.SCALINGO_API_TOKEN }}
- name: Run DB seed
run: scalingo --app if-dev-back-pr${{ github.event.number }} run pnpm db:seed
notify-pr:
if: github.event.pull_request.draft == false && github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
needs: deploy-review-app
steps:
- name: Find existing notification
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.number }}
body-regex: Review app:\nhttps:\/\/if-dev-front-pr
- name: Notify PR about the webapp url
if: steps.find-comment.outputs.comment-id == ''
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Review app:
https://if-dev-front-pr${{ github.event.number }}.osc-fr1.scalingo.io