Update data.json #343
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: Build gh-pages | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
updateOrder: #first job that updates the chronological order of data sets | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
matrix: | |
node-version: [12.x] | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
pip install -r my-app/requirements.txt | |
- name: execute py script | |
run: | | |
python my-app/src/setupData.py | |
- name: Commit files | |
id: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions" | |
git add --all | |
git commit -m "Update Order of Data Sets" -a || echo "Nothing to push" | |
echo "::set-output name=push::true" | |
shell: bash | |
- name: Push changes | |
if: steps.commit.outputs.push == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
buildWebsite: #second job responsible for building the updated version of the application | |
needs: updateOrder | |
runs-on: ubuntu-latest | |
if: always() | |
strategy: | |
max-parallel: 1 | |
matrix: | |
node-version: [12.x] | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm ci & build | |
working-directory: ./my-app | |
run: | | |
npm ci | |
npm run build | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
publish_dir: ./my-app/build | |
cname: ad-datasets.com | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |