From 5c4b13cdafef40dde33bdc86bcb6ef2f8d929ad4 Mon Sep 17 00:00:00 2001 From: Alex Belanger Date: Fri, 8 Mar 2024 22:58:38 -0500 Subject: [PATCH] Second attempt at deploying. --- .github/workflows/candide.yaml | 32 ++++++-------------------------- k8s/deployment.yaml | 5 ++++- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/candide.yaml b/.github/workflows/candide.yaml index d1ee0f16..416f8dbe 100644 --- a/.github/workflows/candide.yaml +++ b/.github/workflows/candide.yaml @@ -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 \ No newline at end of file diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 7682fc42..771bf0bf 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -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: