Vérification de la production #114
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-latest | |
steps: | |
- run: | | |
curl -sSfL https://code.travail.gouv.fr/ | grep -q "Code du travail numérique" | |
- uses: mattermost/action-mattermost-notify@master | |
if: failure() | |
with: | |
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | |
TEXT: |- | |
Le site n'est pas accessible 😱😱😱😱😱😱😱😱 ([logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})) (cc: @max @victorz @carolinebda @martial). | |
robots: | |
name: Check robots.txt | |
runs-on: ubuntu-latest | |
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" | |
- run: | | |
curl -sSfL https://code.travail.gouv.fr/sitemap.xml -o sitemap.xml && grep -q "https://code.travail.gouv.fr/" sitemap.xml | |
- run: | | |
curl -sSfLI https://code.travail.gouv.fr/sitemap.xml | grep -q "content-type: text/xml" | |
- uses: mattermost/action-mattermost-notify@master | |
if: failure() | |
with: | |
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | |
TEXT: |- | |
Erreur sur le robots.txt ou sitemap.xml 😱😱😱😱😱😱😱😱 ([logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})) (cc: @max @victorz @carolinebda @martial). |