Publish: snapshot/v1 #13370
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: 'Publish: snapshot/v1' | |
on: | |
schedule: | |
- cron: 0 */2 * * * | |
push: | |
branches: [ master ] | |
jobs: | |
publish-snapshot: | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.7.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v2 | |
with: | |
ref: master | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- uses: actions/setup-node@master | |
with: | |
node-version: 14.x | |
- name: Install NPM dependencies | |
run: | | |
cd crawler | |
npm install | |
- name: Configure git | |
run: | | |
git config user.email "github-bot@brigade.cloud" | |
git config user.name "Brigade Bot" | |
git fetch origin refs/heads/snapshot/v1:refs/heads/snapshot/v1 refs/heads/cfapi/orgs/v1:refs/heads/cfapi/orgs/v1 | |
- name: Crawl projects | |
env: | |
GITHUB_ACTOR: brigade-bot | |
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
run: | | |
node crawler/run.js \ | |
--all \ | |
--commit-to=snapshot/v1 \ | |
--commit-orgs-to=cfapi/orgs/v1 | |
- name: Push results | |
if: ${{ always() }} | |
run: | | |
git push origin refs/heads/snapshot/v1 refs/heads/cfapi/orgs/v1 |