name: Docker # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. on: workflow_dispatch: schedule: - cron: '42 18 * * 0' jobs: build: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout repository uses: actions/checkout@v2 # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: build run: | cd tools/docker make stable make all make push - name: Create the failure Message if: ${{ failure() }} run: | echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker images ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json - name: Create the success Message if: ${{ success() }} run: | echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker images built and pushed successfully ! You can get it on: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json - uses: mattermost/action-mattermost-notify@master env: MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}