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: jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build Container
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -28,3 +29,25 @@ jobs:
push: true push: true
tags: sarsoo/sarsooxyz.hugo:latest tags: sarsoo/sarsooxyz.hugo:latest
file: Dockerfile.pub 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 job
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build Pages
steps: steps:
- name: Install Hugo CLI - name: Install Hugo CLI
run: sudo apt install hugo run: sudo apt install hugo
@ -58,8 +59,9 @@ jobs:
# Deployment job # Deployment job
deploy: deploy:
name: Deploy Staging
environment: environment:
name: github-pages name: staging
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build