mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
chore: add manifest template and update deploy step to commit rendered manifest
This commit is contained in:
@@ -40,7 +40,7 @@ jobs:
|
||||
needs: test
|
||||
if: github.event_name == 'push'
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
@@ -86,7 +86,15 @@ jobs:
|
||||
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
|
||||
with:
|
||||
args: |-
|
||||
# Update both deployments with new image tags
|
||||
sed -i 's|image: .*|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:1.0.${{ github.run_number }}|' k8s/manifest.yaml
|
||||
# Render template → manifest with the actual image tag
|
||||
sed 's|__IMAGE_TAG__|1.0.${{ github.run_number }}|g' k8s/manifest.template.yaml > k8s/manifest.yaml
|
||||
# Apply Kubernetes manifests
|
||||
kubectl --insecure-skip-tls-verify apply -n ${{ env.K8S_NAMESPACE }} -f k8s/manifest.yaml
|
||||
|
||||
- name: Commit updated manifest
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add k8s/manifest.yaml
|
||||
git commit -m "chore: update manifest image to 1.0.${{ github.run_number }} [skip ci]"
|
||||
git push
|
||||
|
||||
Reference in New Issue
Block a user