split website build and deploy
Build and Push Docker Image / Docker Build and Push (push) Successful in 7s
Build and Push Docker Image / deploy (push) Successful in 16s

This commit is contained in:
2026-08-05 16:20:42 -05:00
parent b22941107e
commit 59acccc3d4
+20 -9
View File
@@ -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