Skip to content

[SENTINEL] added pr build #1

[SENTINEL] added pr build

[SENTINEL] added pr build #1

name: Build Docker Image on PR to ref main branch
on:
pull_request:
branches:
- 'master'
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::$(echo $GITHUB_SHA | head -c 8)"
- 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 }}