Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Docker action: don't rebuild the tuto images each week as they build upon stable
[simgrid.git] / .github / workflows / docker.yml
1 name: Docker
2
3 # This workflow uses actions that are not certified by GitHub.
4 # They are provided by a third-party and are governed by
5 # separate terms of service, privacy policy, and support
6 # documentation.
7
8 on:
9   workflow_dispatch:
10   schedule:
11     - cron: '42 18 * * 0'
12
13 jobs:
14   build:
15
16     runs-on: ubuntu-latest
17     permissions:
18       contents: read
19       packages: write
20
21     steps:
22       - name: Checkout repository
23         uses: actions/checkout@v2
24
25       # Login against a Docker registry except on PR
26       # https://github.com/docker/login-action
27       - name: Log into registry ${{ env.REGISTRY }}
28         uses: docker/login-action@v1
29         with:
30           username: ${{ secrets.DOCKERHUB_USERNAME }}
31           password: ${{ secrets.DOCKERHUB_TOKEN }}
32
33       - name: build
34         run: |
35           cd tools/docker
36           make unstable
37           make push
38       - name: Create the failure Message
39         if: ${{ failure() }}
40         run: |
41           echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker images ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
42       - name: Create the success Message
43         if: ${{ success() }}
44         run: |
45           echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker images built and pushed successfully ! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
46       - uses: mattermost/action-mattermost-notify@master
47         env:
48           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
49           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
50