From: David NĂ©grier <d.negrier@thecodingmachine.com>
Date: Wed, 13 May 2020 20:20:34 +0000 (+0200)
Subject: Fixing CD
X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ad70ecca745def8f393d9a6a95126461cdc9f878;p=libreadventure.git

Fixing CD
---

diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml
index 9794c87..57bebf9 100644
--- a/.github/workflows/build-and-deploy.yml
+++ b/.github/workflows/build-and-deploy.yml
@@ -78,7 +78,7 @@ jobs:
 
       - name: Add a comment in PR
         uses: unsplash/comment-on-pr@v1.2.0
-        if: ${{ github.event_name == 'pull_request' }}
+        if: ${{ env.GITHUB_REF_SLUG != 'master' }}
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         with:
@@ -87,8 +87,8 @@ jobs:
 
       - name: Run Cypress tests
         uses: cypress-io/github-action@v1
+        if: ${{ env.GITHUB_REF_SLUG != 'master' }}
         env:
-          # FIXME: for master, the URL is not the same!
           CYPRESS_BASE_URL: https://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com
         with:
           env: host=${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com,port=80
@@ -96,6 +96,17 @@ jobs:
           wait-on: https://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com
           working-directory: e2e
 
+      - name: Run Cypress tests in prod
+        uses: cypress-io/github-action@v1
+        if: ${{ env.GITHUB_REF_SLUG == 'master' }}
+        env:
+          CYPRESS_BASE_URL: https://workadventu.re
+        with:
+          env: host=workadventu.re
+          spec: cypress/integration/spec.js
+          wait-on: https://workadventu.re
+          working-directory: e2e
+
       - name: "Upload the screenshot on test failure"
         uses: actions/upload-artifact@v1
         if: failure()