-
Notifications
You must be signed in to change notification settings - Fork 34
64 lines (56 loc) · 2.12 KB
/
main.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
name: Deploy process on Pull Request
on:
pull_request_target:
types: [opened, synchronize, closed]
push:
branches:
- 'develop'
jobs:
check-member:
name: Check if we continue the process
runs-on: ubuntu-latest
steps:
- name: Echo PR info
run: |
echo User ${{ github.actor }} is about to ${{ github.event.action }} on this Pull Request.
- name: Check if contributor is an org member
id: is_organization_member
if: github.event_name == 'pull_request_target'
uses: JamesSingleton/[email protected]
with:
organization: Canadian-Geospatial-Platform
username: ${{ github.event.pull_request.head.user.login }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Output comment and end build if not org member
if: github.event_name == 'pull_request_target'
run: |
result=${{ steps.is_organization_member.outputs.result }}
if [ $result == false ]; then
user=${{ github.event.pull_request.head.user.login }}
echo Either ${user} is not part of the Canadian-Geospatial-Platform organization
echo or ${user} has its Organization Visibility set to Private at
echo https://github.com/orgs/Canadian-Geospatial-Platform/people?query=${user}
exit 1
fi
install-build:
name: Develop build for demo files
needs: [check-member]
uses: ./.github/workflows/build.yml
with:
cache_sha: ${{ github.event.pull_request.head.sha || github.sha }}
deploy-pr-pages:
name: Deploy the files for PR
needs: [install-build]
if: github.event.pull_request.merged == false
uses: ./.github/workflows/deploy.yml
with:
cache_sha: ${{ github.event.pull_request.head.sha || github.sha }}
folder: ${{github.head_ref}}
deploy-demo-pages:
name: Deploy the files on public demo
needs: [install-build]
if: github.event.pull_request.merged == true
uses: ./.github/workflows/deploy.yml
with:
cache_sha: ${{ github.event.pull_request.head.sha || github.sha }}
folder: public