fix: Error on Homepage Demo CTA #2888
Workflow file for this run
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: Zesty Website CI Dev | |
on: | |
pull_request: | |
branches: [stage, accounts, production, dev] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
install-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- name: ✅ Checkout code | |
uses: actions/checkout@v4 | |
- name: ⚡️ Cache dependencies | |
uses: actions/cache@v2 | |
id: cache-build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: 🚚 Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm install --force --prefer-offline --no-audit | |
build-check: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20] | |
runs-on: ${{ matrix.os }} | |
needs: install-dependencies | |
steps: | |
- name: ✅ Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: ⚡️ Cache dependencies | |
uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: 📦️ Build | |
run: npm run build | |
lint: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20] | |
runs-on: ${{ matrix.os }} | |
needs: install-dependencies | |
steps: | |
- name: ✅ Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: ⚡️ Cache dependencies | |
uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: ✏️ Run lint | |
run: npm run test-all | |
unit-tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20] | |
runs-on: ${{ matrix.os }} | |
needs: install-dependencies | |
steps: | |
- name: ✅ Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: ⚡️ Cache dependencies | |
uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: 🧪 Run unit tests | |
run: npm run test | |
docker-build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: ✅ Checkout code | |
uses: actions/checkout@v4 | |
- name: 🐳 Docker Build | |
run: docker build -t zesty-website:latest . | |
working-directory: ./ | |
end-to-end-tests-cypress: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20] | |
runs-on: ${{ matrix.os }} | |
env: | |
PRODUCTION: 'true' | |
steps: | |
- name: ✅ Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: 🌐 Setup custom host for mylocal | |
run: echo "127.0.0.1 test.zesty.io" | sudo tee -a /etc/hosts | |
- name: 🚚 Install dependencies | |
run: npm install --force --prefer-offline --no-audit | |
- name: 📝 Write the cypress.env.json file | |
run: | | |
echo '${{ secrets.CYPRESS_ENV_CI }}' > cypress.json | |
- name: 🧪 Run E2E test | |
run: npm run test:e2e:ci:prod | |
- name: 🖼 Save screenshots | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
tests-pass: | |
needs: | |
[ | |
docker-build, | |
build-check, | |
end-to-end-tests-cypress, | |
install-dependencies, | |
lint, | |
unit-tests, | |
] | |
if: always() | |
runs-on: ubuntu-latest | |
name: 🚀🚀🚀 Ok to Proceed 😎 👍👍👍 | |
steps: | |
- run: exit 1 | |
if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')) }} |