fix(apps): elab - studios' semester buttons order. #470
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: Run full build | |
on: | |
push: | |
branches: [main] | |
env: | |
CI: true | |
NODE_ENV: production | |
DB_URI: ${{ secrets.DB_URI }} | |
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
jobs: | |
initial-setup: | |
name: "Initial setup" | |
uses: engagementlab/el-next/.github/workflows/init.yml@main | |
run-build: | |
needs: initial-setup | |
name: "Make build" | |
# Do not run on automated commits (interpretation of TravisCI feature) | |
if: "!contains(github.event.head_commit.message, 'skip ci') && github.actor != 'dependabot[bot]'" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.16] | |
steps: | |
- name: Setup node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Download artifacts from initial-setup job | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ format('artifact-repo-{0}', github.run_id) }} | |
- name: Install global packages | |
run: npm install -g yarn pm2 @preconstruct/cli | |
- name: Install local monorepo packages and run preconstruct | |
run: yarn | |
- name: Make production build | |
working-directory: apps/elab | |
env: | |
GRAPHQL_APP: elab | |
NODE_TLS_REJECT_UNAUTHORIZED: '0' | |
run: | | |
yarn add typescript @types/node | |
yarn | |
yarn build | |
- name: Generate build notes and summary from user | |
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.note != 'null' }} | |
run: echo "(Build commit [${{ steps.commit.outputs.commit_sha }}](https://github.com/$GITHUB_REPOSITORY/commit/${{ steps.commit.outputs.commit_long_sha }}))" >> $GITHUB_STEP_SUMMARY" | |
- name: Install packages | |
working-directory: apps/elab | |
run: npm i -g pa11y-ci http-server pm2 && npm i | |
- name: Serve build | |
working-directory: apps/elab/out | |
run: pm2 start `which http-server` --name server | |
- name: Output all build paths to .pa11yci config and run a11y tests | |
id: pa11y | |
run: | | |
node outputRoutes.mjs --app elab | |
pa11y-ci | |
- name: Run Lighthouse | |
id: lhci | |
uses: foo-software/lighthouse-check-action@master | |
with: | |
fooApiToken: ${{ secrets.FOO_API_KEY }} | |
configFile: 'lhconfig.json' | |
- name: Send success Slack notification | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && success() && steps.lhci.outcome == 'success' }} | |
uses: slackapi/slack-github-action@v1.23.0 | |
with: | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ":goggles: The latest *test* build of our web apps succeeded. _(Build #${{ github.run_number }})_" | |
} | |
} | |
] | |
} | |
# Build has failed due to a11y check(s) not successful | |
- name: Send Slack notification w/ a11y warning | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && failure() && (steps.lhci.outcome == 'failure' || steps.pa11y.outcome == 'failure') }} | |
uses: slackapi/slack-github-action@v1.23.0 | |
with: | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ":goggles: The latest *test* build of our web apps succeeded with warnings. _(Build #${{ github.run_number }})_" | |
} | |
}, | |
{ | |
"type": "context", | |
"elements": [ | |
{ | |
"type": "mrkdwn", | |
"text": ":pushpin: Some accessibility issues exist." | |
} | |
] | |
} | |
] | |
} | |
- name: Send failed Slack notification | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && failure() && steps.lhci.outcome == 'success' }} | |
uses: slackapi/slack-github-action@v1.23.0 | |
with: | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ":woozy_face: The latest *test* build of our web apps failed. _(Build #${{ github.run_number }})_" | |
} | |
}, | |
{ | |
"type": "context", | |
"elements": [ | |
{ | |
"type": "mrkdwn", | |
"text": "(Production deploys will probably fail right now)" | |
} | |
] | |
} | |
] | |
} |