-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
44 lines (41 loc) · 1.31 KB
/
action.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
name: 'Setup Tailscale ssh'
description: 'Setup Tailscale ssh'
inputs:
ts-api-client-id:
description: 'Tailscale API client ID'
required: true
ts-api-client-secret:
description: 'Tailscale API client secret'
required: true
ssh-private-key:
description: 'ssh private key'
required: true
runs:
using: 'composite'
steps:
- name: setup ssh key
shell: bash
run: |
mkdir -p ~/.ssh/
echo "Host brilliant-* analytics-* dev-* qa-*" >> ~/.ssh/config
echo " StrictHostKeyChecking no" >> ~/.ssh/config
echo " Port 55422" >> ~/.ssh/config
echo " User deployer" >> ~/.ssh/config
echo "${{ inputs.ssh-private-key }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- uses: actions/setup-go@v4
with:
go-version: '1.21.0'
- name: generate tailscale auth token
id: tsauth
shell: bash
run: |
TS_AUTHKEY=$(go run tailscale.com/cmd/get-authkey@main -ephemeral -tags tag:server)
echo TS_AUTHKEY=$TS_AUTHKEY >> $GITHUB_OUTPUT
env:
TS_API_CLIENT_ID: ${{ inputs.ts-api-client-id }}
TS_API_CLIENT_SECRET: ${{ inputs.ts-api-client-secret }}
- name: setup tailscale
uses: tailscale/github-action@v1
with:
authkey: ${{ steps.tsauth.outputs.TS_AUTHKEY }}