32 lines
862 B
YAML
32 lines
862 B
YAML
name: Build and Deploy
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: self-hosted
|
|
env:
|
|
KUBECONFIG: /home/opc/.kube/config
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build \
|
|
-t git.ch4t.buzz/djg/helpme-tips:${{ github.sha }} \
|
|
-t git.ch4t.buzz/djg/helpme-tips:latest \
|
|
.
|
|
|
|
- name: Push to registry
|
|
run: |
|
|
docker push git.ch4t.buzz/djg/helpme-tips:${{ github.sha }}
|
|
docker push git.ch4t.buzz/djg/helpme-tips:latest
|
|
|
|
- name: Roll out to k8s
|
|
run: |
|
|
kubectl set image deployment/static-hts \
|
|
nginx=git.ch4t.buzz/djg/helpme-tips:${{ github.sha }} \
|
|
-n default
|
|
kubectl rollout status deployment/static-hts -n default --timeout=120s
|