Skip to content

build

build #1087

Workflow file for this run

name: CI
on:
push:
pull_request:
repository_dispatch:
types: [build]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: actions/cache@v2
name: Cache python dependencies
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install javascript dependencies
run: |
yarn install
- name: Run build
run: |
yarn run build
env:
CODELISTS_BASE_URL: https://codelists.codeforiati.org
- name: Deploy to github pages πŸš€
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GIT_CONFIG_NAME: Code for IATI bot
GIT_CONFIG_EMAIL: 57559326+codeforIATIbot@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.TOKEN }}
BRANCH: gh-pages
FOLDER: docs/.vuepress/dist
SINGLE_COMMIT: true
CLEAN: true
trigger:
runs-on: ubuntu-latest
needs: build
steps:
- name: Trigger a codelist update on the datastore classic repo
if: github.ref == 'refs/heads/main'
uses: peter-evans/repository-dispatch@v1
with:
repository: codeforIATI/iati-datastore
token: ${{ secrets.TOKEN }}
event-type: update-codelists