Deploy Nightly #524
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: Deploy Nightly | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
check_recent_commit: | |
runs-on: ubuntu-latest | |
outputs: | |
commited_recently: ${{ steps.commited_recently.outputs.commited_recently }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: dev | |
- name: Check Commits in the Previous 24h | |
id: commited_recently | |
run: | | |
if [[ $(git rev-list --after="24 hours" ${{ github.sha }}) != "" ]]; then | |
echo "::set-output name=commited_recently::1" | |
echo "[TRIGGERED]" | |
fi | |
deploy: | |
runs-on: ubuntu-latest | |
needs: check_recent_commit | |
if: ${{ needs.check_recent_commit.outputs.commited_recently == '1' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: dev | |
- name: Init Stuff | |
uses: ./.github/actions/init | |
- name: Fetch Deps | |
run: yarn install --frozen-lockfile | |
- name: Create Nightly Version | |
run: npm version $(node ./bin/gen-nightly-version.js) | |
- name: Publish | |
run: npm publish --tag next | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |