adding prod deploy

This commit is contained in:
Andy Pack 2024-07-07 22:45:54 +01:00
parent 6ce1935dea
commit ef4d16c0ae
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7

View File

@ -6,6 +6,7 @@ jobs:
build:
runs-on: ubuntu-latest
name: Build & Unit Test
strategy:
fail-fast: false
matrix:
@ -29,6 +30,7 @@ jobs:
build-Docker:
runs-on: ubuntu-latest
name: Build Containers
needs: [build] # for ignoring bad builds
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
@ -52,3 +54,26 @@ jobs:
sarsoo/overflow:latest
sarsoo/overflow:${{ github.ref_name }}
file: Dockerfile
deploy:
runs-on: ubuntu-latest
name: Deploy
needs: [build-Docker] # for ignoring bad builds
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
environment:
name: prod
url: https://overflow.sarsoo.xyz
steps:
- uses: actions/checkout@v3
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
version: 1.68.1
- name: Deploy
run: ssh -o StrictHostKeyChecking=no ${{ secrets.TS_SSH }} -t "cd overflow/ && docker compose up -d --pull always"