github-action/action.yml
Denton Gentry 446d3fee99 Update to 1.14.0, and slow down loop.
Wait half a second, to poll a bit less aggressively.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-08-25 09:33:53 -07:00

44 lines
1.5 KiB
YAML

# Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
name: 'Connect Tailscale'
description: 'Connect your GitHub Action workflow to Tailscale'
inputs:
authkey:
description: 'Your Tailscale authentication key, from the admin panel.'
required: true
version:
description: 'Tailscale version to use.'
required: true
default: '1.14.0'
runs:
using: 'composite'
steps:
- name: Download Tailscale
shell: bash
id: download
env:
VERSION: ${{ inputs.version }}
run: |
MINOR=$(echo $VERSION | awk -F '.' {'print $2'})
if [ $((MINOR % 2)) -eq 0 ]; then
URL="https://pkgs.tailscale.com/stable/tailscale_${VERSION}_amd64.tgz"
else
URL="https://pkgs.tailscale.com/unstable/tailscale_${VERSION}_amd64.tgz"
fi
curl $URL -o tailscale.tgz
tar -C ${HOME} -xzf tailscale.tgz
rm tailscale.tgz
TSPATH=${HOME}/tailscale_${VERSION}_amd64
sudo mv "${TSPATH}/tailscale" "${TSPATH}/tailscaled" /usr/bin
- name: Run Tailscale
shell: bash
env:
TAILSCALE_AUTHKEY: ${{ inputs.authkey }}
run: |
sudo tailscaled 2>~/tailscaled.log &
HOSTNAME="github-$(cat /etc/hostname)"
until sudo tailscale up --authkey ${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes
do
sleep 0.5
done