Skip to content

Update version on sandbox #190

Update version on sandbox

Update version on sandbox #190

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
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 VM_GIT_COMMIT_SHA="$(git rev-parse --short $GITHUB_SHA)"
export VM_SANDBOX_OPERATOR_PATH="gcp-test/sandbox/manifests/applications/vm-operator.yaml"
yq -i 'with(.spec.source.helm.values; . = (. | from_yaml | .image.tag = strenv(VM_GIT_COMMIT_SHA) | to_yaml))' $VM_SANDBOX_OPERATOR_PATH
git add $VM_SANDBOX_OPERATOR_PATH
git commit -S -m "Automatic update operator version on sandbox from ${GITHUB_REPOSITORY}@${VM_GIT_COMMIT_SHA}"
echo "IMAGE_TAG=$VM_GIT_COMMIT_SHA" >> $GITHUB_OUTPUT
working-directory: "__vm-ops-repo"
env:
GITHUB_TOKEN: ${{ secrets.VM_BOT_GH_TOKEN }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
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`