-
Notifications
You must be signed in to change notification settings - Fork 18
56 lines (50 loc) · 1.54 KB
/
keys.yml
File metadata and controls
56 lines (50 loc) · 1.54 KB
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
54
55
56
name: ⛅ Keys
on:
schedule:
# at 12:53 on 2nd of Feb, June, Oct: crontab.guru/#53_12_2_2,6,10_*
- cron: '53 12 2 2,6,10 *'
workflow_dispatch:
inputs:
environment:
description: 'wrangler env to deploy to'
required: true
default: 'dev'
type: choice
options:
- dev
- prod
jobs:
secrets:
name: 🏇 Secrets
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: 🛸 Checkout
uses: actions/[email protected]
with:
ref: ${{ env.GIT_REF }}
fetch-depth: 0
- name: 🚚 Node
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: 🏗 Wrangler
run: npm i wrangler@3 -g
# ref: github.com/cloudflare/wrangler-action/blob/master/entrypoint.sh
- name: 🚨 Prod?
if: github.event.inputs.environment == 'prod' || github.event.schedule == '53 12 2 2,6,10 *'
run: node ./src/node/prodkeys.js
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
- name: 📚 Dev?
if: github.event.inputs.environment == 'dev'
run: node ./src/node/devkeys.js
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
- name: ⛳️ Notice
# docs.github.com/en/actions/learn-github-actions/expressions
if: ${{ success() }}
run: |
echo "::notice::new keys set"