Fix BuiltOn tag (#111) #84
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'UI - QA Env' | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
check-ui: | |
runs-on: ubuntu-latest | |
name: Check UI for edits | |
outputs: | |
status: ${{ steps.ui-edited.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changes to UI directory | |
id: ui-edited | |
uses: tj-actions/changed-files@v34 | |
with: | |
files: natster-io/** | |
build-ui: | |
runs-on: ubuntu-latest | |
name: Builds UI if edits found | |
needs: check-ui | |
if: needs.check-ui.outputs.status | |
steps: | |
- | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- | |
name: Build ui | |
working-directory: ./natster-io | |
run: | | |
curl -fsSL https://get.pnpm.io/install.sh | SHELL=bash sh - | |
~/.local/share/pnpm/pnpm install | |
~/.local/share/pnpm/pnpm build-only --outDir server/dist | |
- | |
name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.0' | |
- | |
name: Build server | |
working-directory: ./natster-io/server | |
run: | | |
go build -o natster-ui-server-qa | |
- | |
name: Archive server binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tailscale_server | |
retention-days: 1 | |
path: | | |
./natster-io/server/natster-ui-server-qa | |
deployment: | |
runs-on: ubuntu-latest | |
name: Deploy to QA | |
needs: build-ui | |
environment: | |
name: QA | |
url: https://natster-ui.pig-bee.ts.net | |
steps: | |
- | |
name: Download server artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: tailscale_server | |
- | |
name: Tailscale | |
uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
tags: tag:natster | |
- | |
name: Stop QA Server | |
run: | | |
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" [email protected] systemctl stop natster-ui-qa.service | |
- | |
name: Update QA server on host | |
run: | | |
scp -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" natster-ui-server-qa [email protected]:/usr/local/bin/natster-ui-server-qa | |
- | |
name: Restart QA Server | |
run: | | |
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" [email protected] systemctl start natster-ui-qa.service | |