1 name: Docker tutorial S4U
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
10 schedule: # each week-end, since it's using the unstable docker image
12 push: # when pushing on the stable branche, as this is intended to use the stable docker image when not needing the bleeding edge
16 # types: [published, created, edited]
21 runs-on: ubuntu-latest
27 - name: Checkout repository
28 uses: actions/checkout@v2
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
35 username: ${{ secrets.DOCKERHUB_USERNAME }}
36 password: ${{ secrets.DOCKERHUB_TOKEN }}
40 # grep SIMGRID_VERSION_PATCH CMakeLists.txt| grep -q 'SIMGRID_VERSION_PATCH "0"' || (echo "Only run this action on stable source";exit 1)
43 docker push simgrid/tuto-s4u
44 - name: Create the failure Message
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
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
54 MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
55 MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}