This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
Add Open Climate Data Recommendations to best practices #13180
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |