Vérification de la production #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |