Skip to content

fix: Use github action to fetch release version #6

fix: Use github action to fetch release version

fix: Use github action to fetch release version #6

Workflow file for this run

name: Bump geohub-data-pipeline version
on:
# This workflow will be triggered when the new release tag is created on geohub-data-pipeline repository.concurrency:
# https://github.com/UNDP-Data/geohub-data-pipeline/blob/main/.github/workflows/acr_docker_image.yml
repository_dispatch:
types: [bump-pipeline-version]
workflow_dispatch:
pull_request:
jobs:
bump-version:
runs-on: ubuntu-latest
env:
OWNER: undp-data
REPO: geohub-data-pipeline
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: develop
- name: get the latest version
id: pipeline
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: ${{ env.OWNER }}
repo: ${{ env.REPO }}
excludes: prerelease, draft
token: ${{ secrets.GITHUB_TOKEN }}
- name: bump data-pipeline version
working-directory: backends/k8s/data-pipeline/yaml
env:
PIPELINE_VERSION: ${{ steps.pipeline.outputs.release }}
YAML: ingest-environment.yaml
run: |
echo "Latest release version: ${{ env.PIPELINE_VERSION}}"
imagename="undpgeohub.azurecr.io/${{ env.REPO }}"
pattern="${imagename}:[^ ]*"
sed "s|$pattern|$imagename:${{ env.PIPELINE_VERSION}}|g" ${{ env.YAML}} > temp.yaml
# replace yaml file with new version
mv temp.yaml ${{ env.YAML}}
echo "tag version was replace to ${{ env.PIPELINE_VERSION}}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: release/bump-geohub-data-pipeline
title: "[RELEASE] bump version of geohub-data-pipeline"
delete-branch: true
commit-message: "[RELEASE] bump version of geohub-data-pipeline"
body: |
## Description
This is going to bump the version of geohub-data-pipeline to apply the new pipeline docker image to kubernetes cluster
---
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: release
reviewers: |
iferencik
Thuhaa
JinIgarashi