Skip to content

tr discoverswiss: modified access token functionality using native oa… #14

tr discoverswiss: modified access token functionality using native oa…

tr discoverswiss: modified access token functionality using native oa… #14

name: CI/CD tr-discoverswiss-lodging
on:
push:
paths:
- "transformers/discoverswiss-lodging/infrastructure/**"
- "transformers/discoverswiss-lodging/src/**"
- ".github/workflows/tr-discoverswiss-lodging.yml"
env:
PROJECT_NAME: tr-discoverswiss-lodging
WORKING_DIRECTORY: transformers/discoverswiss-lodging
DOCKER_IMAGE: ghcr.io/noi-techpark/opendatahub-collectors/tr-discoverswiss-lodging
DOCKER_TAG: ${{ github.sha }}
KUBERNETES_NAMESPACE: collector
jobs:
build:
runs-on: ubuntu-22.04
concurrency: tr-discoverswiss-lodging-build
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Build and push images
uses: noi-techpark/github-actions/docker-build-and-push@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
deploy-test:
if: github.ref == 'refs/heads/main'
needs:
- build
runs-on: ubuntu-22.04
concurrency: tr-discoverswiss-lodging-deploy-test
environment: test
env:
VALUES_YAML: infrastructure/helm/values.yaml
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Customize values.yaml
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
yq -i '.image.repository = "${{ env.DOCKER_IMAGE }}"' ${{ env.VALUES_YAML }}
yq -i '.image.tag = "${{ env.DOCKER_TAG }}"' ${{ env.VALUES_YAML }}
yq -i '.image.pullPolicy = "IfNotPresent"' ${{ env.VALUES_YAML }}
yq -i '.envSecret.ODH_CORE_TOKEN_PASSWORD = "${{ secrets.ODH_CORE_TOKEN_PASSWORD_DISCOVERSWISS }}"' ${{ env.VALUES_YAML }}
yq -i '.envSecret.ODH_CORE_TOKEN_CLIENT_SECRET = "${{ secrets.ODH_CORE_TOKEN_CLIENT_SECRET_DISCOVERSWISS }}"' ${{ env.VALUES_YAML }}
- name: Deploy on cluster
uses: noi-techpark/github-actions/helm-deploy@v2
with:
k8s-name: ${{ env.PROJECT_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