Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
f4219b8bb522c9135983e47151b30c13a45876bb
[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   # Rebuild when changing the stable branch
10   push:
11       branches:
12             - stable
13 #  release:
14 #    types: [published, created, edited]
15
16 jobs:
17   build:
18
19     runs-on: ubuntu-latest
20     permissions:
21       contents: read
22       packages: write
23
24     steps:
25       - name: Checkout repository
26         uses: actions/checkout@v2
27
28       # Login against a Docker registry except on PR
29       # https://github.com/docker/login-action
30       - name: Log into registry ${{ env.REGISTRY }}
31         uses: docker/login-action@v1
32         with:
33           username: ${{ secrets.DOCKERHUB_USERNAME }}
34           password: ${{ secrets.DOCKERHUB_TOKEN }}
35
36       - name: build
37         run: |
38           cd tools/docker
39           make stable tuto-s4u tuto-smpi tuto-mc
40           docker push simgrid/stable
41           docker push simgrid/unstable
42           docker push simgrid/tuto-s4u
43           docker push simgrid/tuto-smpi
44           docker push simgrid/tuto-mc
45       - name: Create the failure Message
46         if: ${{ failure() }}
47         run: |
48           echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker images ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
49       - name: Create the success Message
50         if: ${{ success() }}
51         run: |
52           echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker images built and pushed successfully ! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
53       - uses: mattermost/action-mattermost-notify@master
54         env:
55           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
56           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
57