Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bummer
[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   docker-simgrid:
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
42           docker push simgrid/stable
43       - name: Create the failure Message
44         if: ${{ failure() }}
45         run: |
46           ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building STABLE docker image $ver! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
47       - name: Create the success Message
48         if: ${{ success() }}
49         run: |
50           ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker STABLE image $ver built and pushed successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
51       - uses: mattermost/action-mattermost-notify@master
52         env:
53           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
54           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
55
56
57   docker-tuto-s4u:
58
59     # the Dockerfile builds upon the docker-unstable image, so add a dependency
60     needs: docker-simgrid
61     runs-on: ubuntu-latest
62     permissions:
63       contents: read
64       packages: write
65
66     steps:
67       - name: Checkout repository
68         uses: actions/checkout@v2
69
70       # Login against a Docker registry except on PR
71       # https://github.com/docker/login-action
72       - name: Log into registry ${{ env.REGISTRY }}
73         uses: docker/login-action@v1
74         with:
75           username: ${{ secrets.DOCKERHUB_USERNAME }}
76           password: ${{ secrets.DOCKERHUB_TOKEN }}
77
78       - name: build docker tuto-s4u
79         run: |
80           cd tools/docker
81           make tuto-s4u
82           docker push simgrid/tuto-s4u
83       - name: Create the failure Message
84         if: ${{ failure() }}
85         run: |
86           ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker tuto-s4u image $ver! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
87       - name: Create the success Message
88         if: ${{ success() }}
89         run: |
90           ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker tuto-s4u $ver image built and pushed successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
91       - uses: mattermost/action-mattermost-notify@master
92         env:
93           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
94           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
95
96   docker-tuto-smpi:
97     # the Dockerfile builds upon the docker-stable image, so add a dependency
98     needs: docker-simgrid
99     
100     runs-on: ubuntu-latest
101     permissions:
102       contents: read
103       packages: write
104
105     steps:
106       - name: Checkout repository
107         uses: actions/checkout@v2
108
109       # Login against a Docker registry except on PR
110       # https://github.com/docker/login-action
111       - name: Log into registry ${{ env.REGISTRY }}
112         uses: docker/login-action@v1
113         with:
114           username: ${{ secrets.DOCKERHUB_USERNAME }}
115           password: ${{ secrets.DOCKERHUB_TOKEN }}
116
117       - name: build
118         run: |
119           grep SIMGRID_VERSION_PATCH CMakeLists.txt| grep -q 'SIMGRID_VERSION_PATCH "0"' || (echo "Only run this action on stable source";exit 1)
120           cd tools/docker
121           make tuto-smpi
122           docker push simgrid/tuto-smpi
123       - name: Create the failure Message
124         if: ${{ failure() }}
125         run: |
126           ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building SMPI $ver docker image on stable docker! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
127       - name: Create the success Message
128         if: ${{ success() }}
129         run: |
130           ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker SMPI $ver stable image built and pushed successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
131       - uses: mattermost/action-mattermost-notify@master
132         env:
133           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
134           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
135