-
Notifications
You must be signed in to change notification settings - Fork 12
40 lines (36 loc) · 1.13 KB
/
tailscale.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
name: Sync Tailscale
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
acl-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if Tailscale file has changed
id: tailscale-changes
uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c # v45
with:
files: |
policy.hujson
- uses: actions/checkout@v4
- name: Sync ACL with Tailscale
if: github.event_name == 'push' && steps.tailscale-changes.outputs.any_changed == 'true'
id: deploy-acl
uses: tailscale/gitops-acl-action@v1
with:
api-key: ${{ secrets.TS_API_KEY }}
tailnet: ${{ secrets.TS_TAILNET }}
action: apply
- name: Test newer ACL configs
if: github.event_name == 'pull_request' && steps.tailscale-changes.outputs.any_changed == 'true'
id: test-acl
uses: tailscale/gitops-acl-action@v1
with:
api-key: ${{ secrets.TS_API_KEY }}
tailnet: ${{ secrets.TS_TAILNET }}
action: test