Skip to content

Correction deploy template Github Actions. #8

Correction deploy template Github Actions.

Correction deploy template Github Actions. #8

name: Deploy Dataflow Flex Template
env:
PROJECT_ID: gb-poc-373711
LOCATION: europe-west1
CI_SERVICE_NAME: github-actions
REPO_NAME: internal-images
IMAGE_NAME: "dataflow/team-league-java"
IMAGE_TAG: latest
METADATA_FILE: "config/metadata.json"
METADATA_TEMPLATE_FILE_PATH: "gs://mazlum_dev/dataflow/templates/team_league/java/team-league-java"
SDK_LANGUAGE: "JAVA"
FLEX_TEMPLATE_BASE_IMAGE: JAVA11
JAR: "target/teams-league-0.1.0.jar"
FLEX_TEMPLATE_JAVA_MAIN_CLASS: "fr.groupbees.application.TeamLeagueApp"
JOB_NAME: "team-league-java"
TEMP_LOCATION: "gs://mazlum_dev/dataflow/temp"
STAGING_LOCATION: "gs://mazlum_dev/dataflow/staging"
SA_EMAIL: "sa-dataflow-dev@gb-poc-373711.iam.gserviceaccount.com"
INPUT_FILE: "gs://mazlum_dev/team_league/input/json/input_teams_stats_raw.json"
SIDE_INPUT_FILE: "gs://mazlum_dev/team_league/input/json/input_team_slogans.json"
TEAM_LEAGUE_DATASET: "mazlum_test"
TEAM_STATS_TABLE: "team_stat"
JOB_TYPE: "team_league_java_ingestion_job"
FAILURE_OUTPUT_DATASET: "mazlum_test"
FAILURE_OUTPUT_TABLE: "job_failure"
FAILURE_FEATURE_NAME: "team_league"
on:
push:
branches: [ main, feature/* ]
pull_request:
branches: [ main ]
jobs:
deploy-template:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: 'Checkout'
uses: 'actions/checkout@v3'
- name: 'Google auth'
id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/975119474255/locations/global/workloadIdentityPools/github-actions-ci-cd-pool/providers/github-actions-ci-cd-provider'
service_account: 'sa-dataflow-dev@gb-poc-373711.iam.gserviceaccount.com'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
with:
version: '>= 444.0.0'
project_id: '${{ env.PROJECT_ID }}'
- name: 'Docker auth'
run: |-
gcloud auth configure-docker ${{ env.LOCATION }}-docker.pkg.dev
- name: 'Build Flex Template Docker image'
run: |-
docker build -t "${{ env.LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}/${{ env.CI_SERVICE_NAME }}:${{ env.IMAGE_TAG }}"
docker push "${{ env.LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}/${{ env.CI_SERVICE_NAME }}:${{ env.IMAGE_TAG }}"
- name: 'Create Flex Template Spec file'
run: |
scripts/create_flex_template_spec_file_gcs.sh