1
0
Files
test-php/.github/workflows/cicd.yaml
felegy 2a2eb1dade
Some checks failed
/ build-and-deploy (push) Failing after 1m1s
+ ADD github build action via kpack
2025-08-18 13:16:06 +00:00

34 lines
1.1 KiB
YAML

on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: benjlevesque/short-sha@v3.0
id: short-sha
with:
length: 8
- name: Install kpack CLI
run: |
curl -L <https://github.com/vmware-tanzu/kpack-cli/releases/download/v0.5.0/kp-linux-0.5.0> -o kp
chmod +x kp
sudo mv kp /usr/local/bin/
- name: Configure kubectl
uses: azure/k8s-set-context@v1
with:
kubeconfig: ${{ secrets.KUBE_CONFIG }}
- name: Update kpack image
env:
SHA: ${{ github.sha }}
SHORT_SHA: ${{ steps.short-sha.outputs.sha }}
run: |
kp image patch tutorial-image --replace-additional-tag "ghcr.io/hvg-dev/php-test:sha-${SHORT_SHA}" --git-revision "${SHA}" -n test-builder
- name: Wait for build to complete
run: |
kp build logs tutorial-image -n test-builder
# - name: Update Kubernetes deployment
# run: |
# kubectl set image deployment/my-app my-app=<registry>/<repository>:${{ github.sha }}