Skip to content

dc-g-sheets: production cicd for sta-echarging, remove obsolete deplo… #9

dc-g-sheets: production cicd for sta-echarging, remove obsolete deplo…

dc-g-sheets: production cicd for sta-echarging, remove obsolete deplo… #9

name: CI/CD dc-google-spreadsheet creative-industries
on:
push:
paths:
- "collectors/google-spreadsheet/**"
- "collectors/lib/ingress-mq/**"
- ".github/workflows/dc-google-spreadsheet-build.yml"
- ".github/workflows/dc-google-spreadsheet-creative-industries.yml"
- "!collectors/google-spreadsheet/infrastructure/helm/*.yaml"
- "collectors/google-spreadsheet/infrastructure/helm/creative_industries.yaml"
env:
WORKING_DIRECTORY: collectors/google-spreadsheet
DOCKER_IMAGE: ghcr.io/noi-techpark/opendatahub-collectors/dc-google-spreadsheet
DOCKER_TAG: ${{ github.sha }}
KUBERNETES_NAMESPACE: collector
JAVA_VERSION: 17
VALUES_YAML: infrastructure/helm/creative_industries.yaml
K8S_NAME: dc-google-spreadsheet-creative-industries
jobs:
build:
uses: ./.github/workflows/dc-google-spreadsheet-build.yml
secrets: inherit
deploy-test:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-22.04
concurrency: dc-google-spreadsheet-creative-industries-test
environment: test
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Write environment-specific Helm values
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
cat <<EOF > override.yml
image:
repository: ${{ env.DOCKER_IMAGE }}
tag: ${{ env.DOCKER_TAG }}
pullPolicy: "IfNotPresent"
envSecret:
SHEETS_CLIENT_ID: ${{ secrets.G_SHEETS_CLIENT_ID }}
SHEETS_CLIENT_SECRET: ${{ secrets.G_SHEETS_CLIENT_SECRET }}
SHEETS_REFRESH_TOKEN: ${{ secrets.G_SHEETS_REFRESH_TOKEN }}
SPREADSHEET_ID: ${{ secrets.G_SHEETS_STA_ECHARGING_ID }}
EOF
# Merge yaml files https://mikefarah.gitbook.io/yq/operators/multiply-merge
yq -i '. *= load("override.yml")' ${{ env.VALUES_YAML }}
- name: Deploy on cluster
uses: noi-techpark/github-actions/helm-deploy@v2
with:
k8s-name: ${{ env.K8S_NAME }}
k8s-namespace: collector
chart-path: helm/generic-collector
values-file: ${{ env.WORKING_DIRECTORY}}/${{ env.VALUES_YAML }}
aws-access-key-id: ${{ secrets.AWS_DEV_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEV_ACCESS_KEY_SECRET }}
aws-eks-cluster-name: aws-main-eu-01
aws-region: eu-west-1