forked from noobaa/noobaa-core
-
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.
- Loading branch information
1 parent
ed45caa
commit e870cb9
Showing
1 changed file
with
44 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,44 @@ | ||
name: okd-release | ||
|
||
on: | ||
workflow_dispatch: {} | ||
jobs: | ||
image-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push docker images | ||
env: | ||
IMAGE_REPOSITORY: ghcr.io/teamziax/noobaa-core | ||
run: | | ||
function strip_prefix() { | ||
local str="$1" | ||
local prefix="$2" | ||
echo ${str#"$prefix"} | ||
} | ||
function get_noobaa_version() { | ||
local version=$(cat package.json | jq -r .version) | ||
local without_v=$(strip_prefix "$version" v) | ||
echo "v$without_v" | ||
} | ||
make all | ||
docker tag noobaa ${IMAGE_REPOSITORY}/noobaa-core:$(get_noobaa_version) | ||
docker push ${IMAGE_REPOSITORY}/noobaa-core:$(get_noobaa_version) |