From 111159f383f92586f47f0968bfc9615c211badcd Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Tue, 2 Jul 2024 03:36:51 +0100 Subject: [PATCH] Add deployment CI job --- .github/workflows/deploy.yaml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..4e006d8 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,54 @@ +name: Deploy site + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + environment: production + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '22' + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Tailscale + uses: tailscale/github-action@v2 + with: + oauth-client-id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TAILSCALE_OAUTH_CLIENT_SECRET }} + tags: tag:ci + + - name: Configure SSH + run: | + mkdir -p ~/.ssh/ + echo "$SSH_KEY" > ~/.ssh/production.key + chmod 600 ~/.ssh/production.key + cat >>~/.ssh/config <