Skip to content

Docker build container #535

Docker build container

Docker build container #535

name: Docker build container
on:
pull_request:
branches:
- main
schedule:
- cron: "15 7 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
permissions: {}
jobs:
docker-build-container-production:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Get repository name
id: repo-basename
run: |
echo "repo=$(basename ${{ github.repository }})" >> "$GITHUB_OUTPUT"
shell: bash
- name: Build docker image
uses: senzing-factory/github-action-docker-buildx-build@v2
with:
image-repository: senzing/${{ steps.repo-basename.outputs.repo }}
image-tag: ${{ github.ref_name }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
- name: Notify Slack on failure
if: (failure() || cancelled()) && (github.ref_name == github.event.repository.default_branch || github.event_name == 'schedule')
uses: senzing-factory/build-resources/slack-failure-notification@v4
with:
job-status: ${{ job.status }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
docker-build-container-staging:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Get repo name
id: repo-basename
run: |
echo "repo=$(basename ${{ github.repository }})" >> "$GITHUB_OUTPUT"
shell: bash
- name: Build docker image
uses: senzing-factory/github-action-docker-buildx-build@v2
with:
build-options: |
SENZING_APT_REPOSITORY_NAME=${{ vars.SENZING_APT_STAGING_REPOSITORY_PACKAGE }}
SENZING_APT_REPOSITORY_URL=${{ vars.SENZING_APT_STAGING_REPOSITORY_URL }}
image-repository: senzing/${{ steps.repo-basename.outputs.repo }}
image-tag: ${{ github.ref_name }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
- name: Notify Slack on failure
if: (failure() || cancelled()) && (github.ref_name == github.event.repository.default_branch || github.event_name == 'schedule')
uses: senzing-factory/build-resources/slack-failure-notification@v4
with:
job-status: ${{ job.status }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}