Generate apply-base docker image #965
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: "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 }} |