[SENTINEL] added pr build #1
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
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 }} |