Skip to content

Generate apply-ci docker image #1027

Generate apply-ci docker image

Generate apply-ci docker image #1027

name: "Generate apply-ci docker image"
on:
schedule:
- cron: '30 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_ci.dockerfile --tag ministryofjustice/apply-ci:latest --tag ministryofjustice/apply-ci:latest-$(cat .ruby-version)
- name: Push the Docker image
run: |
docker push ministryofjustice/apply-ci:latest
docker push ministryofjustice/apply-ci:latest-$(cat .ruby-version)
- name: Slack Notification on failure
if: failure()
uses: slackapi/[email protected]
with:
channel-id: 'apply-devtest'
payload: |
{
"text": "GitHub apply-ci docker image Action build result: ${{ job.status }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub apply-ci docker Action build result: ${{ job.status }}\nAn error occurred while generating the apply-ci docker image"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}