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
89 lines (81 loc) · 2.54 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
82
83
84
85
86
87
88
89
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
- name: Check country names in digital public goods JSON files
run: npm run cleanCountries
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- 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}}
NEXT_PUBLIC_MAPBOX_TOKEN: ${{ secrets.NEXT_PUBLIC_MAPBOX_TOKEN }}
NEXT_PUBLIC_SHEET_ID: ${{ secrets.NEXT_PUBLIC_SHEET_ID }}
run: ./scripts/push.bash
# As of May 2021, this integration is disabled. Leaving it commented it out for reference.
# open_pr:
# needs: build
# runs-on: ubuntu-latest
# if: |
# github.ref == 'refs/heads/main' &&
# !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/[email protected]
# - 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/main'
steps:
- uses: actions/checkout@v2
- id: file_changes
uses: trilom/[email protected]
- name: Install dependencies
run:
npm install
- name: Update API
env:
GITHUBTOKEN: ${{ secrets.GITHUBTOKEN }}
run:
node scripts/api.js