Skip to content

Commit

Permalink
Migrate graham-banano
Browse files Browse the repository at this point in the history
  • Loading branch information
bbedward committed Jun 28, 2024
1 parent a9cce2d commit 1556766
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 48 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,40 +130,40 @@ jobs:
with:
args: apply -f ./kubernetes/nano/deployment-k.yaml

# deploy_graham_banano:
# name: Deploy graham bot (banano)
# needs: build_and_publish
# runs-on: ubuntu-latest
# env:
# GITHUB_RUN_ID: ${{ github.run_id }}
# steps:
# - uses: actions/checkout@master
# - uses: imranismail/setup-kustomize@v1
# with:
# kustomize-version: "3.x"
deploy_graham_banano:
name: Deploy graham bot (banano)
needs: build_and_publish
runs-on: ubuntu-latest
env:
GITHUB_RUN_ID: ${{ github.run_id }}
steps:
- uses: actions/checkout@master
- uses: imranismail/setup-kustomize@v1
with:
kustomize-version: '3.x'

# - name: Get branch name (merge)
# if: github.event_name != 'pull_request'
# shell: bash
# run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV

# - name: Get branch name (pull request)
# if: github.event_name == 'pull_request'
# shell: bash
# run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV

# - name: Set image
# working-directory: ./kubernetes/graham_banano
# run: |
# kustomize edit set image replaceme=bananocoin/graham:${{ env.BRANCH_NAME }}-${{ env.GITHUB_RUN_ID }}
# kustomize build . > deployment-k.yaml
- name: Set image
working-directory: ./kubernetes/graham_banano
run: |
kustomize edit set image replaceme=bananocoin/graham:${{ env.BRANCH_NAME }}-${{ env.GITHUB_RUN_ID }}
kustomize build . > deployment-k.yaml
# - name: Deploy image to k8s cluster
# uses: bbedward/kubectl@master
# env:
# KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# with:
# args: apply -f ./kubernetes/graham_banano/deployment-k.yaml
- name: Deploy image to k8s cluster
uses: bbedward/kubectl@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: apply -f ./kubernetes/graham_banano/deployment-k.yaml

# deploy_bananobot:
# name: Deploy BananoBot++
Expand Down
12 changes: 3 additions & 9 deletions kubernetes/graham_banano/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@ spec:
- name: REDIS_DB
value: "7"
- name: POSTGRES_HOST
value: postgres.kubegres
value: pg-grahambanano.graham-nano
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: graham-banano
key: postgres_db
value: postgres
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: graham-banano
key: postgres_user
value: postgres
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
Expand Down
12 changes: 3 additions & 9 deletions kubernetes/graham_banano/deployment_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@ spec:
- name: REDIS_DB
value: "7"
- name: POSTGRES_HOST
value: postgres.kubegres
value: pg-grahambanano.graham-nano
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: graham-banano
key: postgres_db
value: postgres
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: graham-banano
key: postgres_user
value: postgres
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
Expand Down

0 comments on commit 1556766

Please sign in to comment.