Build image on MAIN branch #2
Workflow file for this run
This file contains 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: Build image on MAIN branch | |
on: | |
push: | |
tags: | |
- 'v*' | |
pull_request: | |
tags: | |
- 'v*' | |
jobs: | |
package-image: | |
runs-on: ubuntu-latest | |
if: contains(github.event.head_commit.message, '[release]') | |
environment: | |
name: production # Set the environment name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to VngCloud Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ vars.VCR_REGISTRY }} | |
username: ${{ secrets.VCR_USERNAME }} | |
password: ${{ secrets.VCR_PASSWORD }} | |
- name: Get previous tag | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: 1.0.0 # Optional fallback tag to use when no tag can be found | |
#workingDirectory: another/path/where/a/git/repo/is/checked/out # Optional alternative working directory | |
- name: Build and push vngcloud-blockstorage-csi-driver image | |
env: | |
NEW_VERSION: ${{ steps.previoustag.outputs.tag }} | |
run: | | |
export REGISTRY=${{ vars.VCR_REGISTRY }} | |
export VERSION=${NEW_VERSION} | |
make bush-local-images |