Files
scottyah-blog/.gitea/workflows/deploy.yaml
Scott Hatlen 318fc88319
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 44s
Add manual workflow dispatch trigger
2026-03-09 19:24:59 -07:00

38 lines
1.2 KiB
YAML

name: Build and Deploy
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: quay.io/buildah/stable
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build image
run: |
IMAGE=harbor.scottyah.com/scottyah/blog
buildah bud -t $IMAGE:${{ github.sha }} -t $IMAGE:latest .
- name: Push image
run: |
IMAGE=harbor.scottyah.com/scottyah/blog
buildah login -u "${{ secrets.HARBOR_USERNAME }}" -p "${{ secrets.HARBOR_PASSWORD }}" harbor.scottyah.com
buildah push $IMAGE:${{ github.sha }}
buildah push $IMAGE:latest
- name: Deploy
run: |
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG_DATA }}" | base64 -d > ~/.kube/config
sed -i "s|harbor.scottyah.com/scottyah/blog:latest|harbor.scottyah.com/scottyah/blog:${{ github.sha }}|" k8s.yaml
./kubectl apply -f k8s.yaml
./kubectl rollout status deployment/blog-dep -n blog --timeout=120s