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: workflow_dispatch:
jobs: jobs:
build-and-push-image: build:
name: 'Docker Build and Push' name: 'Docker Build and Push'
env: env:
REGISTRY_USERNAME: nicholas REGISTRY_USERNAME: nicholas
IMAGE_REGISTRY: git.uuard.com IMAGE_REGISTRY: git.uuard.com
IMAGE_NAME: nicholas/personal-website IMAGE_NAME: nicholas/personal-website
IMAGE_TAG: ${{ github.sha }} IMAGE_TAG: ${{ github.sha }}
runs-on: ubuntu-latest runs-on: shared-ci
steps: steps:
- name: ⬇️ Checkout repo - name: ⬇️ Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -31,6 +31,19 @@ jobs:
- name: 🚀 Push Docker image - name: 🚀 Push Docker image
run: docker push $IMAGE_REGISTRY/$IMAGE_NAME:$IMAGE_TAG 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 - name: Install kubectl
env: env:
KUBECTL_VERSION: v1.36.2 KUBECTL_VERSION: v1.36.2
@@ -38,8 +51,10 @@ jobs:
set -euo pipefail 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"
curl -fsSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256" curl -fsSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256"
printf '%s %s\n' "$(cat kubectl.sha256)" kubectl | sha256sum --check printf '%s %s\n' "$(cat kubectl.sha256)" kubectl | sha256sum -c
sudo install -m 0755 kubectl /usr/local/bin/kubectl 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 - name: Configure Kubernetes access
env: env:
@@ -47,7 +62,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
mkdir -p ~/.kube mkdir -p ~/.kube
printf '%s' "$KUBE_CONFIG" | base64 --decode > ~/.kube/config printf '%s' "$KUBE_CONFIG" | base64 -d > ~/.kube/config
chmod 600 ~/.kube/config chmod 600 ~/.kube/config
kubectl auth can-i update deployments --namespace nicholas kubectl auth can-i update deployments --namespace nicholas
@@ -64,7 +79,3 @@ jobs:
--namespace nicholas --timeout=180s --namespace nicholas --timeout=180s
exit 1 exit 1
fi fi
- name: 🧹 Prune images
if: always()
run: docker image prune -f