[build][refactor] refactor code #7
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 | |
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=${{ github.ref_name }} | |
make bush-local-images |