Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bf95828a7405bab8b1f902170629cbafa0589729
[simgrid.git] / .github / workflows / docker-stable.yml
1 name: Docker stable
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   # Rebuild when changing the stable branch
11   push:
12       branches:
13             - stable
14 #  release:
15 #    types: [published, created, edited]
16
17 jobs:
18   build:
19
20     runs-on: ubuntu-latest
21     permissions:
22       contents: read
23       packages: write
24
25     steps:
26       - name: Checkout repository
27         uses: actions/checkout@v2
28
29       # Login against a Docker registry except on PR
30       # https://github.com/docker/login-action
31       - name: Log into registry ${{ env.REGISTRY }}
32         uses: docker/login-action@v1
33         with:
34           username: ${{ secrets.DOCKERHUB_USERNAME }}
35           password: ${{ secrets.DOCKERHUB_TOKEN }}
36
37       - name: build
38         run: |
39           grep SIMGRID_VERSION_PATCH CMakeLists.txt| grep -q 'SIMGRID_VERSION_PATCH "0"' || (echo "Only run this action on stable source";exit 1)
40           cd tools/docker
41           make stable tuto-smpi
42           docker push simgrid/stable
43           docker push simgrid/tuto-smpi
44       - name: Create the failure Message
45         if: ${{ failure() }}
46         run: |
47           echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building STABLE 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 STABLE 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