Skip to content

Commit

Permalink
added github action to publish image on private registry
Browse files Browse the repository at this point in the history
  • Loading branch information
troeggla committed May 16, 2024
1 parent d8f5396 commit 78de023
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build_image.yml
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

0 comments on commit 78de023

Please sign in to comment.