Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -75,4 +75,42 @@ jobs:
|
||||
run: |
|
||||
docker buildx rm $BUILDER_NAME || true
|
||||
|
||||
- name: Set image name
|
||||
id: export
|
||||
run: |
|
||||
echo "image=registry.bigdata.pens.ac.id/$IMAGE_NAME:$IMAGE_TAG" >> $GITEA_OUTPUT
|
||||
|
||||
outputs:
|
||||
image: ${{ steps.export.outputs.image }}
|
||||
|
||||
deploy:
|
||||
runs-on: k8s-runner-01
|
||||
needs: build
|
||||
env:
|
||||
IMAGE_NAME: ${{ gitea.repository }}
|
||||
DIGEST_IMAGE: ${{ needs.build.outputs.image }}
|
||||
steps:
|
||||
- name: "Checkout repository"
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: "Generate Dockerfile"
|
||||
run: curl -o k8s.yml https://n8n.mceasy.cloud/webhook/generator/manifest?type=k8s
|
||||
|
||||
- name: "Replace APP_NAME"
|
||||
run: |
|
||||
NAME=$(echo "$IMAGE_NAME" | sed 's/\//-/g')
|
||||
sed -i "s|APP_NAME|$NAME|g" k8s.yml
|
||||
sed -i "s|IMAGE_NAME|$DIGEST_IMAGE|g" k8s.yml
|
||||
cat k8s.yml
|
||||
|
||||
- name: "Set kubeconfig"
|
||||
run: |
|
||||
mkdir -p /root/.kube
|
||||
echo "${{ vars.KUBECONFIG_PA_DEVOPS }}" > /root/.kube/config
|
||||
|
||||
- name: "Deploy to Cluster"
|
||||
run: |
|
||||
cat /root/.kube/config
|
||||
kubectl apply -f k8s.yml --validate=false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user