forked from wes-lin/Cloud189Checkin
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (53 loc) · 1.61 KB
/
run.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
53
name: Cloud check in action
on:
push:
branches:
- main
- dev
watch:
types: started
workflow_dispatch:
schedule:
#- cron: 35 3 * * * # 分(0-59) 小时(0-23) 日期(1-31) 月份(1-12) 星期(0-7) 年(可选字段)
- cron: 20 22 * * *
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: user
steps:
- uses: actions/checkout@main
- name: Setup Node.js environment
uses: actions/setup-node@main
with:
node-version: 18
- name: init secrets
uses: shine1594/secrets-to-env-action@master
with:
secrets: ${{ toJSON(secrets) }}
secrets_env: production
prefix_prod: ""
file_name_prod: .env
- name: init
run: npm install
- name: run
id: run
uses: nick-fields/retry@master
with:
timeout_minutes: 10
max_attempts: 3
command: npm start
- name: Keep Running
run: |
git config --local user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git remote set-url origin https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}
git pull --rebase --autostash
git commit --allow-empty -m "Keep Running..."
git push
- name: Delete old workflow run
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 50