Skip to content

Vérification de la production #34

Vérification de la production

Vérification de la production #34

name: Vérification de la production
on:
workflow_run:
workflows: ["🚀 Production"]
types:
- completed
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: verification-production-${{ github.ref }}
jobs:
live:
name: Check if the site is live
runs-on: ubuntu-18.04
steps:
- run: |
curl -sSfL https://code.travail.gouv.fr/ | grep -q "Code du travail numérique"
- name: Create the Mattermost Message
if: failure()
run: |
echo "{\"text\":\"Le site n'est pas accessible : ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}\"}" > mattermost.json
- uses: mattermost/action-mattermost-notify@master
if: failure()
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
robots:
name: Check robots.txt
runs-on: ubuntu-18.04
steps:
- run: |
curl -sSfL https://code.travail.gouv.fr/robots.txt | grep -q "User-agent: *"
- run: |
curl -sSfL https://code.travail.gouv.fr/robots.txt | grep -q "Disallow: /assets/"
- run: |
curl -sSfL https://code.travail.gouv.fr/robots.txt | grep -q "Disallow: /images/"
- run: |
curl -sSfL https://code.travail.gouv.fr/robots.txt | grep -q "Sitemap: https://code.travail.gouv.fr/sitemap.xml"
- name: Create the Mattermost Message
if: failure()
run: |
echo "{\"text\":\"Erreur sur le robots.txt 😱😱😱😱😱😱😱😱 ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}\"}" > mattermost.json
- uses: mattermost/action-mattermost-notify@master
if: failure()
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}