Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic check on that the production dashboard is accessible #2257

Open
depombo opened this issue Mar 15, 2023 · 1 comment
Open

Periodic check on that the production dashboard is accessible #2257

depombo opened this issue Mar 15, 2023 · 1 comment

Comments

@depombo
Copy link
Member

depombo commented Mar 15, 2023

We use to have the job below that when deploying to staging would run the entire test suite, but it was quite flaky. We could write a smaller integration test that runs periodically in CI and probes the production dashboard

name: Deploy UI to staging

on:
  push:
    branches: [main]
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - name: Check out repo
        uses: actions/checkout@v3
      # Node is required for npm
      - name: Set up Node
        uses: actions/setup-node@v2
        with:
          node-version: "16"
      - name: Set CNAME
        run: |
          touch public/CNAME
          echo app-staging.iasql.com >> public/CNAME
      # Install and build website
      - name: Build website
        run: |
          yarn
          yarn install 
          yarn build
        env:
          REACT_APP_IASQL_ENV: staging
      - name: Deploy to GitHub Pages
        if: success()
        uses: crazy-max/ghaction-github-pages@v2
        with:
          target_branch: gh-pages
          build_dir: build
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  sleep:
    runs-on: ubuntu-latest
    needs:
      - publish
    steps:
      - name: sleep
        run: sleep 10

  test:
    timeout-minutes: 20
    runs-on: ubuntu-latest
    needs:
      - sleep
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v2
        with:
          node-version: "16"
      - name: Install dependencies
        run: yarn
      - name: Install Playwright
        run: npx playwright install --with-deps
      - name: Run Playwright tests
        run: yarn playwright test
        env:
          TEST_ACCOUNT_EMAIL: [email protected]
          TEST_ACCOUNT_PASSWORD: ${{ secrets.TEST_ACCOUNT_PASSWORD }}
          AWS_REGION: us-east-2
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }}
          REACT_APP_IASQL_ENV: staging
          WEBSITE_URL: https://app-staging.iasql.com/
      # https://github.com/actions/upload-artifact#where-does-the-upload-go
      # Download artifact and upload to https://trace.playwright.dev
      - uses: actions/upload-artifact@v2
        if: always()
        with:
          name: test-results
          path: test-results/
          retention-days: 7
  notify:
    name: Discord Notification
    runs-on: ubuntu-latest
    needs: # make sure the notification is sent AFTER the jobs you want included have completed
      - publish
      - test
    if: ${{ always() }} # You always want to be notified: success, failure, or cancelled

    steps:
      - name: Notify
        uses: nobrayner/discord-webhook@v1
        with:
          github-token: ${{ secrets.github_token }}
          discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}

@depombo depombo converted this from a draft issue Mar 15, 2023
@depombo
Copy link
Member Author

depombo commented Mar 15, 2023

Stems from #2255

@depombo depombo moved this from In Progress to Todo in IaSQL Sprint Board Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant