-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.3 KB
/
snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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 }}