Skip to content

[SENTINEL] added pr build #11

[SENTINEL] added pr build

[SENTINEL] added pr build #11

name: Build Docker Image on PR to ref main branch
on:
pull_request:
branches:
- 'master'
workflow_run:
workflows: ["Dev CI/CD"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout out the repo
uses: actions/checkout@v2
- name: Log into the Container registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set Docker tag as short commit sha
id: tag
run: echo "::set-output name=TAG::dev-${{ github.event.pull_request.number }}"
- uses: jgierer12/npm-auth-gpr@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ secrets.DOCKER_HUB_REPO }}:${{ steps.tag.outputs.TAG }}