From 59acccc3d4315c20ea1838be7090ed02230d4aa9 Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Wed, 5 Aug 2026 16:20:42 -0500 Subject: [PATCH] split website build and deploy --- .gitea/workflows/build-and-push-image.yml | 29 ++++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/build-and-push-image.yml b/.gitea/workflows/build-and-push-image.yml index 63152ac..4dc67d9 100644 --- a/.gitea/workflows/build-and-push-image.yml +++ b/.gitea/workflows/build-and-push-image.yml @@ -6,14 +6,14 @@ on: workflow_dispatch: jobs: - build-and-push-image: + build: name: 'Docker Build and Push' env: REGISTRY_USERNAME: nicholas IMAGE_REGISTRY: git.uuard.com IMAGE_NAME: nicholas/personal-website IMAGE_TAG: ${{ github.sha }} - runs-on: ubuntu-latest + runs-on: shared-ci steps: - name: ⬇️ Checkout repo uses: actions/checkout@v4 @@ -31,6 +31,19 @@ jobs: - name: 🚀 Push Docker image run: docker push $IMAGE_REGISTRY/$IMAGE_NAME:$IMAGE_TAG + - name: 🧹 Prune images + if: always() + run: docker image prune -f + + deploy: + needs: build + runs-on: personal-website-deploy + env: + IMAGE_TAG: ${{ github.sha }} + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v4 + - name: Install kubectl env: KUBECTL_VERSION: v1.36.2 @@ -38,8 +51,10 @@ jobs: set -euo pipefail curl -fsSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" curl -fsSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256" - printf '%s %s\n' "$(cat kubectl.sha256)" kubectl | sha256sum --check - sudo install -m 0755 kubectl /usr/local/bin/kubectl + printf '%s %s\n' "$(cat kubectl.sha256)" kubectl | sha256sum -c + mkdir -p "$HOME/.local/bin" + install -m 0755 kubectl "$HOME/.local/bin/kubectl" + printf '%s\n' "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Configure Kubernetes access env: @@ -47,7 +62,7 @@ jobs: run: | set -euo pipefail mkdir -p ~/.kube - printf '%s' "$KUBE_CONFIG" | base64 --decode > ~/.kube/config + printf '%s' "$KUBE_CONFIG" | base64 -d > ~/.kube/config chmod 600 ~/.kube/config kubectl auth can-i update deployments --namespace nicholas @@ -64,7 +79,3 @@ jobs: --namespace nicholas --timeout=180s exit 1 fi - - - name: 🧹 Prune images - if: always() - run: docker image prune -f