Skip to content

Update version on sandbox #823

Update version on sandbox

Update version on sandbox #823

Workflow file for this run

name: Update version on sandbox
on:
workflow_dispatch:
ref: master
branches:
- master
permissions:
teams:
- development
inputs:
branch:
description: 'Branch to deploy'
required: true
default: master
type: string
permissions:
contents: read
pull-requests: write
jobs:
update:
name: Update version on sandbox
runs-on: ubuntu-latest
steps:
- name: Checkout operator
uses: actions/checkout@v5
with:
repository: VictoriaMetrics/operator
ref: ${{ github.event.inputs.branch }}
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
check-latest: true
cache: true
id: go
- name: Publish image
id: publish
run: |
echo ${{secrets.REPO_KEY}} | docker login --username ${{secrets.REPO_USER}} --password-stdin
export IMAGE_TAG=$(git rev-parse --short HEAD)
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
TAG=$IMAGE_TAG make docker-push
- name: Checkout ops
uses: actions/checkout@v5
with:
repository: VictoriaMetrics/ops
ref: main
token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: __vm-ops-repo
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: import-gpg
with:
gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
workdir: __vm-ops-repo
- name: Update operator version on sandbox
id: update
run: |
export OPERATOR_PATH=gcp-test/sandbox/manifests/applications/vm-operator.yaml
yq -i '.spec.source.helm.valuesObject.image.tag = strenv(IMAGE_TAG)' $OPERATOR_PATH
echo "OPERATOR_PATH=$OPERATOR_PATH" >> $GITHUB_OUTPUT
working-directory: __vm-ops-repo
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
add-paths: ${{ steps.update.outputs.OPERATOR_PATH }}
commit-message: Automatic update operator version on sandbox from ${{ github.repository }}@${{ steps.publish.outputs.IMAGE_TAG }}
signoff: true
committer: "Github Actions <${{ steps.import-gpg.outputs.email }}>"
path: __vm-ops-repo
branch: sandbox-operator-release-automation
token: ${{ secrets.VM_BOT_GH_TOKEN }}
delete-branch: true
title: 'sandbox: update operator ${{ steps.publish.outputs.IMAGE_TAG }}'
body: |
Deploy [${{ steps.publish.outputs.IMAGE_TAG }}"](https://github.com/VictoriaMetrics/operator/commit/${{ steps.publish.outputs.IMAGE_TAG }}) to sandbox
> Auto-generated by `Github Actions Bot`