Skip to content

Update to node 16 and replace ember-cli-deploy-compress #4511

Update to node 16 and replace ember-cli-deploy-compress

Update to node 16 and replace ember-cli-deploy-compress #4511

Workflow file for this run

name: CI [web-client]
on:
pull_request:
paths:
- "packages/web-client/**"
- "packages/boxel/**"
- "packages/cardpay-sdk/**"
- "packages/did-resolver/**"
- "packages/wc-provider/**"
- "packages/test-support/**"
- "packages/eslint-config/**"
- ".github/workflows/pr-web-client.yml"
- "package.json"
- "yarn.lock"
permissions:
contents: read
issues: read
checks: write
pull-requests: write
id-token: write
statuses: write
jobs:
test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/init
# using yarn to install @percy/cli suddenly started causing V8 out of
# memory errors. According to https://stackoverflow.com/a/56568741 likely
# there is a dependency cycle that yarn can't see through. However, npm
# has the ability to collapse these cycles. So we are using npm to install
# percy
- run: npm install -g @percy/cli
- name: Run tests
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_WEB_CLIENT }}
run: yarn test:web-client:percy
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: "web-client test results"
files: ci-xml-test-results/web-client.xml
check-if-requires-preview:
name: Check if a preview deploy is required
runs-on: ubuntu-latest
outputs:
web-client-files-changed: ${{ steps.web-client-files-that-changed.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
- name: Get web client files that changed
id: web-client-files-that-changed
uses: tj-actions/changed-files@v35
with:
files: |
**/packages/web-client
deploy-web-client-preview-staging:
name: Deploy a web-client staging preview to S3
runs-on: ubuntu-latest
# github.event.pull_request.head.repo.full_name == github.repository: true if pr is from the original repo, false if it's from a fork
# github.head_ref: the branch that the pull request is from. only appears on pull_request events
if: github.event.pull_request.head.repo.full_name == github.repository && github.head_ref && needs.check-if-requires-preview.outputs.web-client-files-changed == 'true'
needs: check-if-requires-preview
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2.0.0
with:
role-to-assume: arn:aws:iam::680542703984:role/web-client
aws-region: us-east-1
- name: Deploy web-client preview
uses: ./.github/actions/deploy-web-client-preview
env:
HUB_URL: https://hub-staging.stack.cards
SENTRY_AUTH_TOKEN: ${{ secrets.WEB_CLIENT_SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.WEB_CLIENT_SENTRY_DSN }}
S3_PREVIEW_BUCKET_NAME: web-client-preview.stack.cards
S3_PREVIEW_REGION: us-east-1
with:
environment: staging
deploy-web-client-preview-production:
name: Deploy a web-client production preview to S3
runs-on: ubuntu-latest
# github.event.pull_request.head.repo.full_name == github.repository: true if pr is from the original repo, false if it's from a fork
# github.head_ref: the branch that the pull request is from. only appears on pull_request events
if: github.event.pull_request.head.repo.full_name == github.repository && github.head_ref && needs.check-if-requires-preview.outputs.web-client-files-changed == 'true'
needs: check-if-requires-preview
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2.0.0
with:
role-to-assume: arn:aws:iam::120317779495:role/web-client
aws-region: us-east-1
- name: Deploy web-client preview
uses: ./.github/actions/deploy-web-client-preview
env:
HUB_URL: https://hub.cardstack.com
SENTRY_AUTH_TOKEN: ${{ secrets.WEB_CLIENT_SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.WEB_CLIENT_SENTRY_DSN }}
S3_PREVIEW_BUCKET_NAME: web-client-preview.cardstack.com
S3_PREVIEW_REGION: us-east-1
with:
environment: production