Nightly Sync of content #1674
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: Nightly Sync of content | |
on: | |
schedule: | |
- cron: '0 3 * * *' # run daily at 3am | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: npm | |
- name: Set safe directory | |
run: git config --global --add safe.directory /github/workspace | |
- name: Install | |
run: npm ci | |
- name: Collect latest releases | |
run: npm run build | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v4 | |
with: | |
author_name: GitHub Action | |
author_email: action@github.com | |
message: "feat: Nightly Sync" | |
- name: Push changes | |
# Only run this on the main nodejs repo and not forks | |
if: github.repository == 'chicoxyzzy/node-releases' | |
uses: ad-m/github-push-action@v0.5.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tag a new release | |
run: | |
npm version patch | |
git push --follow-tags | |
- name: Publish to npm | |
if: github.repository == 'chicoxyzzy/node-releases' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish | |