Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a github action to rebuild the stable docker images
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 7 Oct 2021 23:43:33 +0000 (01:43 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 7 Oct 2021 23:43:33 +0000 (01:43 +0200)
.github/workflows/docker-stable.yml [new file with mode: 0644]

diff --git a/.github/workflows/docker-stable.yml b/.github/workflows/docker-stable.yml
new file mode 100644 (file)
index 0000000..f4219b8
--- /dev/null
@@ -0,0 +1,57 @@
+name: Docker stable
+
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+on:
+  # Rebuild when changing the stable branch
+  push:
+      branches:
+            - stable
+#  release:
+#    types: [published, created, edited]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: write
+
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+
+      # Login against a Docker registry except on PR
+      # https://github.com/docker/login-action
+      - name: Log into registry ${{ env.REGISTRY }}
+        uses: docker/login-action@v1
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+      - name: build
+        run: |
+          cd tools/docker
+          make stable tuto-s4u tuto-smpi tuto-mc
+          docker push simgrid/stable
+          docker push simgrid/unstable
+          docker push simgrid/tuto-s4u
+          docker push simgrid/tuto-smpi
+          docker push simgrid/tuto-mc
+      - name: Create the failure Message
+        if: ${{ failure() }}
+        run: |
+          echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker images ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+      - name: Create the success Message
+        if: ${{ success() }}
+        run: |
+          echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker images built and pushed successfully ! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+      - uses: mattermost/action-mattermost-notify@master
+        env:
+          MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
+          MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
+