adding cd for prod

This commit is contained in:
Andy Pack 2024-07-02 20:30:45 +01:00
parent be41040b10
commit 645198efe5
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
2 changed files with 26 additions and 1 deletions

View File

@ -10,6 +10,7 @@ on:
jobs:
docker:
runs-on: ubuntu-latest
name: Build Container
steps:
- uses: actions/checkout@v3
@ -28,3 +29,25 @@ jobs:
push: true
tags: sarsoo/sarsooxyz.hugo:latest
file: Dockerfile.pub
deploy:
runs-on: ubuntu-latest
name: Deploy Prod
needs: [docker] # for ignoring bad builds
environment:
name: prod
url: https://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 aj@odb -t "cd sarsooxyz-hugo/ && docker compose up -d --pull always"

View File

@ -29,6 +29,7 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
name: Build Pages
steps:
- name: Install Hugo CLI
run: sudo apt install hugo
@ -58,8 +59,9 @@ jobs:
# Deployment job
deploy:
name: Deploy Staging
environment:
name: github-pages
name: staging
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build