Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge the docker-tuto-s4u action into docker, to ease synchronization issues
[simgrid.git] / .github / workflows / docker.yml
1 name: Docker unstable
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   docker-unstable:
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 docker unstable
34         run: |
35           cd tools/docker
36           make unstable
37           docker push simgrid/unstable
38       - name: Create the failure Message
39         if: ${{ failure() }}
40         run: |
41           echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker unstable ! 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 unstable 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
51   docker-tuto-s4u:
52
53     needs: docker-unstable
54     runs-on: ubuntu-latest
55     permissions:
56       contents: read
57       packages: write
58
59     steps:
60       - name: Checkout repository
61         uses: actions/checkout@v2
62
63       # Login against a Docker registry except on PR
64       # https://github.com/docker/login-action
65       - name: Log into registry ${{ env.REGISTRY }}
66         uses: docker/login-action@v1
67         with:
68           username: ${{ secrets.DOCKERHUB_USERNAME }}
69           password: ${{ secrets.DOCKERHUB_TOKEN }}
70
71       - name: build docker tuto-s4u
72         run: |
73           make tuto-s4u
74           docker push simgrid/tuto-s4u
75       - name: Create the failure Message
76         if: ${{ failure() }}
77         run: |
78           echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker tuto-s4u image ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
79       - name: Create the success Message
80         if: ${{ success() }}
81         run: |
82           echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker tuto-s4u image built and pushed successfully ! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
83       - uses: mattermost/action-mattermost-notify@master
84         env:
85           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
86           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
87
88   docker-tuto-mc:
89
90     needs: docker-unstable
91     runs-on: ubuntu-latest
92     permissions:
93       contents: read
94       packages: write
95
96     steps:
97       - name: Checkout repository
98         uses: actions/checkout@v2
99
100       # Login against a Docker registry except on PR
101       # https://github.com/docker/login-action
102       - name: Log into registry ${{ env.REGISTRY }}
103         uses: docker/login-action@v1
104         with:
105           username: ${{ secrets.DOCKERHUB_USERNAME }}
106           password: ${{ secrets.DOCKERHUB_TOKEN }}
107
108       - name: build docker tuto-mc
109         run: |
110           make tuto-mc
111           docker push simgrid/tuto-mc
112
113       - name: Create the failure Message
114         if: ${{ failure() }}
115         run: |
116           echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker tuto-mc image ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
117       - name: Create the success Message
118         if: ${{ success() }}
119         run: |
120           echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker tuto-mc image built and pushed successfully ! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
121       - uses: mattermost/action-mattermost-notify@master
122         env:
123           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
124           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
125