generated from onedr0p/cluster-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (45 loc) · 1.75 KB
/
sync-cloudflare-networks.yaml
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
---
name: "Publish Cloudflare Networks"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
env:
DEFAULT_CLOUDFLARE_NETWORKS_FILE: |-
cluster/apps/networking/traefik/cloudflare-networks.txt
jobs:
cloudflare-networks:
name: Cloudflare Networks
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
id: generate-token
with:
app_id: "${{ secrets.APP_ID }}"
private_key: "${{ secrets.APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
token: "${{ steps.generate-token.outputs.token }}"
- name: Cloudflare Networks
run: |
cloudflare_networks_file=$(find . -name "cloudflare-networks.txt" -print -quit)
if [[ -f "${cloudflare_networks_file}" ]]; then
npx zx ./.github/scripts/cloudflareNetworks.mjs > "${cloudflare_networks_file}"
exit 0
fi
npx zx ./.github/scripts/cloudflareNetworks.mjs > ${{ env.DEFAULT_CLOUDFLARE_NETWORKS_FILE }}
- name: Create pull request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
token: "${{ steps.generate-token.outputs.token }}"
branch: github-action/update-cloudflare-networks
delete-branch: true
title: "chore(github-action): update cloudflare networks"
signoff: true
commit-message: "chore(github-action): update cloudflare networks"
body: |
Update cloudflare networks from https://api.cloudflare.com/client/v4/ips
labels: |
renovate/github-action