Publish Npm Downloads 🚀 #249
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 Npm Downloads 🚀 | |
on: | |
workflow_dispatch: | |
schedule: | |
# - cron: '0 0 */3 * *' # Runs at 00:00 UTC every 3 days | |
# - cron: '0 0 * * *' # Runs at 00:00 UTC every day | |
- cron: '0 19 * * *' # Runs at 19:00 UTC every day | |
jobs: | |
publish-npm-downloads: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out current commit | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.9.0 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install and Build | |
run: | | |
yarn | |
yarn dev | |
- name: Configure Git | |
run: | | |
git config --global user.email "developers@cosmology.zone" | |
git config --global user.name "Cosmology" | |
- name: Check if there are any changes | |
id: verify_diff | |
run: | | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: | | |
git add . | |
git commit -m "update 🛠" | |
git status | |
- name: Push | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: git push | |
env: | |
GH_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} |