Skip to content

Generate apply-base docker image #965

Generate apply-base docker image

Generate apply-base docker image #965

name: "Generate apply-base docker image"
on:
schedule:
- cron: '45 5 * * *'
workflow_dispatch:
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PAT }}
- uses: actions/checkout@v4
- name: Build the Docker image
run: |
docker build . --file ./docker/apply_base.dockerfile --tag ministryofjustice/apply-base:latest --tag ministryofjustice/apply-base:latest-$(cat .ruby-version)
- name: Push the Docker image
run: |
docker push ministryofjustice/apply-base:latest
docker push ministryofjustice/apply-base:latest-$(cat .ruby-version)
- name: Slack Notification on failure
if: failure()
uses: slackapi/[email protected]
with:
channel-id: 'apply-devtest'
payload: |
{
"text": "GitHub apply-base docker image Action build result: ${{ job.status }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub apply-base docker Action build result: ${{ job.status }}\nAn error occurred while generating the apply-base docker image"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}