-
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.
added github action to publish image on private registry
- Loading branch information
Showing
1 changed file
with
33 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,33 @@ | ||
name: Build and publish image | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Build docker image and push to registry | ||
runs-on: ubuntu-24.04 | ||
env: | ||
IMAGE_NAME: ${{ secrets.DOCKER_REGISTRY }}/vr2gather-orchestrator-v2 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Extract tag name | ||
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Get current revision SHA | ||
run: git rev-parse HEAD > REVISION | ||
|
||
- name: Login to registry | ||
run: docker login -u ${{ secrets.DOCKER_USER }} -p "${{ secrets.DOCKER_PASS }}" ${{ secrets.DOCKER_REGISTRY }} | ||
|
||
- name: Build Docker image | ||
run: docker build . --file Dockerfile --tag $IMAGE_NAME:$TAG_NAME | ||
|
||
- name: Run linter | ||
run: docker run $IMAGE_NAME:$TAG_NAME yarn lint | ||
|
||
- name: Publish Docker image | ||
run: docker push $IMAGE_NAME:$TAG_NAME |