Skip to content

Commit 30ecd1c

Browse files
feat: push docker image to gitlab registry
1 parent 31ae095 commit 30ecd1c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,6 @@ jobs:
7070
env:
7171
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7272
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
GITLAB_USER: ${{ secrets.GITLAB_USER }}
74+
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
7375
run: ./scripts/release || exit 0

scripts/release

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,23 @@ ghr $(cat .ghr) bin/
1414
# docker build
1515
export IMAGE_NAME="docker.pkg.github.com/go-semantic-release/semantic-release/semantic-release"
1616
export IMAGE_NAME_VERSION="$IMAGE_NAME:$VERSION"
17+
export GL_IMAGE_NAME="registry.gitlab.com/go-semantic-release/semantic-release"
18+
export GL_IMAGE_NAME_VERSION="$GL_IMAGE_NAME:$VERSION"
1719

1820
docker build --build-arg VERSION=$VERSION -t $IMAGE_NAME_VERSION .
1921
docker tag $IMAGE_NAME_VERSION $IMAGE_NAME
22+
docker tag $IMAGE_NAME_VERSION $GL_IMAGE_NAME
23+
docker tag $IMAGE_NAME_VERSION $GL_IMAGE_NAME_VERSION
2024

21-
# push to docker hub
25+
# push to GitHub Docker Registry
2226
docker login docker.pkg.github.com -u $GITHUB_ACTOR -p $GITHUB_TOKEN
2327
docker push $IMAGE_NAME_VERSION
2428
docker push $IMAGE_NAME
2529

30+
# push to GitLab Docker Registry
31+
docker login registry.gitlab.com -u $GITLAB_USER -p $GITLAB_TOKEN
32+
docker push $GL_IMAGE_NAME_VERSION
33+
docker push $GL_IMAGE_NAME
34+
2635
# publish npm package
2736
cd ./npm-package && npm publish

0 commit comments

Comments
 (0)