This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 154
81 lines (72 loc) · 2.1 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependecies
run: npm install
- name: Validate JSON schema
run: npm test
- name: Linter
run: npm run lint
- name: Check filenames
run: ./scripts/check-filenames.bash
- name: Check order of fields in each file
run: npm run order
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Install dependecies
run: npm install
# - name: Run Server
# run: |
# git clone https://github.com/unicef/publicgoods-wordpress.git ../publicgoods-wordpress;
# pushd ../publicgoods-wordpress;
# php -S localhost:8000 &
# popd
- name: Deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN}}
run: ./scripts/push.bash
open_pr:
needs: build
runs-on: ubuntu-latest
if: |
github.ref == 'refs/heads/master' &&
!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[skip pr]') &&
!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[pr skip]')
steps:
- uses: actions/checkout@v2
- id: file_changes
uses: trilom/file-changes-action@v1.2.3
- name: Install dependencies
run:
npm install
- name: open PR
env:
GITHUBTOKEN: ${{ secrets.GITHUBTOKEN }}
run:
node scripts/open_pr.js
api:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- id: file_changes
uses: trilom/file-changes-action@v1.2.3
- name: Install dependencies
run:
npm install
- name: Update API
env:
GITHUBTOKEN: ${{ secrets.GITHUBTOKEN }}
run:
node scripts/api.js