Second attempt at deploying.

This commit is contained in:
Alex Belanger 2024-03-08 22:58:38 -05:00
parent 3b023f34be
commit 5c4b13cdaf
No known key found for this signature in database
GPG Key ID: 31736D2B10A5F158
2 changed files with 10 additions and 27 deletions

View File

@ -1,4 +1,4 @@
name: Deploy candide for Libera
name: candide
on:
push:
@ -15,8 +15,8 @@ env:
IMAGE: pbot
jobs:
build-deploy-gke-prod:
name: Build & Deploy to GKE in Production
build:
name: Build & Deploy
runs-on: ubuntu-latest
permissions:
@ -35,13 +35,6 @@ jobs:
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
#- name: 'Set up Cloud SDK'
# uses: 'google-github-actions/setup-gcloud@v1'
#- name: Setup kubectl
# id: install-kubectl
# uses: azure/setup-kubectl@v3
- name: Set up GKE credentials
uses: google-github-actions/get-gke-credentials@v2
with:
@ -63,21 +56,8 @@ jobs:
- name: Push image
run: |-
docker push "gcr.io/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA"
# - name: Set up Kustomize
# run: |-
# curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64
# chmod u+x ./kustomize
#
# - name: Deploy image
# run: |-
# # replacing the image name in the k8s template
# ./kustomize edit set image LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG=gcr.io/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA
# ./kustomize build . | kubectl apply -f -
# kubectl rollout status deployment/$DEPLOYMENT_NAME
# kubectl get services -o wide
- name: Deploy image
- name: Deploy
run: |-
sed -i -e 's/IMAGE_PLACEHOLDER/'$PROJECT_ID/$REPOSITORY/$IMAGE:${{ github.sha }}'/' k8s/deployment.yaml
sed -e "s/PROJECT_ID/$PROJECT_ID/g" -e "s/REPOSITORY/$REPOSITORY/g" -e "s/IMAGE/$IMAGE/g" -e "s/GITHUB_SHA/$GITHUB_SHA/g" k8s/deployment.yaml
kubectl apply -f k8s/deployment.yaml

View File

@ -19,7 +19,7 @@ spec:
spec:
containers:
- name: candide
image: IMAGE_PLACEHOLDER
image: gcr.io/PROJECT_ID/REPOSITORY/IMAGE:GITHUB_SHA
volumeMounts:
- mountPath: /mnt/persistent
name: persistent
@ -30,6 +30,9 @@ spec:
limits:
cpu: "0.5"
memory: 500Mi
args:
- "data_dir=/mnt/persistent"
- "irc.botnick=candide_"
volumes:
- name: persistent
persistentVolumeClaim: