.github/workflows/sync-data.yml
name: sync-data
on:
schedule:
# update every day at 7AM
- cron: '0 7 * * *'
jobs:
sync-data:
runs-on: ubuntu-latest
outputs:
DATA_CHANGED: ${{ steps.scrape.outputs.DATA_CHANGED }}
steps:
- uses: actions/checkout@v2
- name: Import GPG key for kaskadi-bot
uses: crazy-max/ghaction-import-gpg@v2
with:
git_user_signingkey: true
git_commit_gpgsign: true
env:
GPG_PRIVATE_KEY: ${{ secrets.KASKADI_BOT_GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.KASKADI_BOT_GPG_PRIVATE_PASSPHRASE }}
- name: Scrape data from Collmex
id: scrape
uses: kaskadi/action-collmex-scraper@master
env:
CMX_USER: ${{ secrets.CMX_USER }}
CMX_PWD: ${{ secrets.CMX_PWD }}
CMX_CUST_ID: ${{ secrets.CMX_CUST_ID }}
SATZARTEN_PATH: ${{ secrets.SATZARTEN_PATH }}
publish:
runs-on: ubuntu-latest
needs: sync-data
if: needs.sync-data.outputs.DATA_CHANGED == 'true'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Pull latest commit
run: |
git config pull.rebase false
git pull
- name: Install dependencies
run: npm i
- name: Test
run: npm test
env:
INIT_CLIENT_OPTS: ${{ secrets.INIT_CLIENT_OPTS }}
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}