Skip to content

Update version on sandbox #359

Update version on sandbox

Update version on sandbox #359

Workflow file for this run

name: Update version on sandbox
on:
workflow_run:
workflows: ["Build and Test"]
branches: ["master"]
types:
- completed
jobs:
update:
name: Update version on sandbox
runs-on: ubuntu-latest
steps:
- name: Check out ops
uses: actions/checkout@v4
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 SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)
export OPERATOR_PATH=gcp-test/sandbox/manifests/applications/vm-operator.yaml
yq -i '.spec.source.helm.valuesObject.image.tag = strenv(SHORT_SHA)' $OPERATOR_PATH
echo "IMAGE_TAG=$VM_GIT_COMMIT_SHA" >> $GITHUB_OUTPUT
echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "OPERATOR_PATH=$OPERATOR_PATH" >> $GITHUB_OUTPUT
working-directory: __vm-ops-repo
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
add-paths: ${{ steps.update.outputs.OPERATOR_PATH }}
commit-message: Automatic update operator version on sandbox from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }}
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.update.outputs.IMAGE_TAG }}'
body: |
Deploy [${{ steps.update.outputs.IMAGE_TAG }}"](https://github.com/VictoriaMetrics/operator/commit/${{ steps.update.outputs.IMAGE_TAG }}) to sandbox
> Auto-generated by `Github Actions Bot`