Skip to content

bump-cogserver-version #41

bump-cogserver-version

bump-cogserver-version #41

name: Bump cogserver 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-cogserver-version]
workflow_dispatch:
jobs:
bump-version:
runs-on: ubuntu-latest
env:
OWNER: undp-data
REPO: geo-cogserver
NAME: cogserver
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: develop
- name: get the latest version
id: server
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: ${{ env.OWNER }}
repo: ${{ env.REPO }}
excludes: prerelease, draft
token: ${{ secrets.GITHUB_TOKEN }}
- name: bump cogserver-dev version
working-directory: backends/k8s/cogserver/yaml
env:
SERVER_VERSION: ${{ steps.server.outputs.release }}
YAML: cogserver-dev-deployment.yaml
run: |
echo "Latest release version: ${{ env.SERVER_VERSION}}"
imagename="ghcr.io/${{ env.OWNER }}/${{ env.NAME }}"
echo "Image name is: ${imagename}"
pattern="${imagename}:[^ ]*"
sed "s|$pattern|$imagename:${{ env.SERVER_VERSION}}|g" ${{ env.YAML}} > temp.yaml
# replace yaml file with new version
mv temp.yaml ${{ env.YAML}}
echo "tag for ${{ env.YAML}} was set to ${{ env.SERVER_VERSION}}"
- name: bump cogserver version
working-directory: backends/k8s/cogserver/yaml
env:
SERVER_VERSION: ${{ steps.server.outputs.release }}
YAML: cogserver-deployment.yaml
run: |
echo "Latest release version: ${{ env.SERVER_VERSION}}"
imagename="ghcr.io/${{ env.OWNER }}/${{ env.NAME }}"
echo "Image name is: ${imagename}"
pattern="${imagename}:[^ ]*"
sed "s|$pattern|$imagename:${{ env.SERVER_VERSION}}|g" ${{ env.YAML}} > temp.yaml
# replace yaml file with new version
mv temp.yaml ${{ env.YAML}}
echo "tag for ${{ env.YAML}} was set to ${{ env.SERVER_VERSION}}"
- name: bump docker-compose's version
working-directory: docker
env:
SERVER_VERSION: ${{ steps.server.outputs.release }}
YAML: docker-compose.yml
run: |
echo "Latest release version: ${{ env.SERVER_VERSION}}"
imagename="ghcr.io/${{ env.OWNER }}/${{ env.NAME }}"
echo "Image name is: ${imagename}"
pattern="${imagename}:[^ ]*"
sed "s|$pattern|$imagename:${{ env.SERVER_VERSION}}|g" ${{ env.YAML}} > temp.yaml
# replace yaml file with new version
mv temp.yaml ${{ env.YAML}}
echo "tag for ${{ env.YAML}} was set to ${{ env.SERVER_VERSION}}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: release/bump-cogserver
title: "[RELEASE] cogserver"
delete-branch: true
commit-message: "[RELEASE] cogserver"
body: |
## Description
This is going to bump the version of cogserver to apply the new 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