-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] add github action for release and deploy on prod
- Loading branch information
1 parent
05e714d
commit 9d3237a
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Release vngcloud-blockstorage-csi-driver project | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
name: GoReleaser build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/ | ||
|
||
- name: Set up Go 1.22 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22 | ||
id: go | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# .goreleaser.yaml | ||
builds: | ||
- main: cmd/vngcloud-blockstorage-csi-driver/main.go |
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