Update version on sandbox #827
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: 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-build | |
| 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 }}@${{ env.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 ${{ env.IMAGE_TAG }}' | |
| body: | | |
| Deploy [${{ env.IMAGE_TAG }}](https://github.com/VictoriaMetrics/operator/commit/${{ env.IMAGE_TAG }}) to sandbox | |
| > Auto-generated by `Github Actions Bot` |