Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This docker is now based on simgrid/unstable so it should be rebuilt each week-end
[simgrid.git] / .github / workflows / docker-tuto-s4u.yml
1 name: Docker tutorial S4U
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: # each week-end, since it's using the unstable docker image
11       - cron: '0 20 * * 0'
12   push: # when pushing on the stable branche, as this is intended to use the stable docker image when not needing the bleeding edge
13       branches:
14             - stable
15 #  release:
16 #    types: [published, created, edited]
17
18 jobs:
19   build:
20
21     runs-on: ubuntu-latest
22     permissions:
23       contents: read
24       packages: write
25
26     steps:
27       - name: Checkout repository
28         uses: actions/checkout@v2
29
30       # Login against a Docker registry except on PR
31       # https://github.com/docker/login-action
32       - name: Log into registry ${{ env.REGISTRY }}
33         uses: docker/login-action@v1
34         with:
35           username: ${{ secrets.DOCKERHUB_USERNAME }}
36           password: ${{ secrets.DOCKERHUB_TOKEN }}
37
38       - name: build
39         run: |
40           # grep SIMGRID_VERSION_PATCH CMakeLists.txt| grep -q 'SIMGRID_VERSION_PATCH "0"' || (echo "Only run this action on stable source";exit 1)
41           cd tools/docker
42           make tuto-s4u
43           docker push simgrid/tuto-s4u
44       - name: Create the failure Message
45         if: ${{ failure() }}
46         run: |
47           echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building tuto-s4u docker images ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
48       - name: Create the success Message
49         if: ${{ success() }}
50         run: |
51           echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker tuto-s4u images built and pushed successfully ! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
52       - uses: mattermost/action-mattermost-notify@master
53         env:
54           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
55           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
56