feat: APPS-3023 Create composable useContentIndexer to index craft data used on all routes for FTVA #423
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: Run CI Suite | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ci-${{ github.ref_name=='main' && github.sha || github.ref_name }} # Cancel runs for previous version of PR, but not main (after merge). For hacked ternary, see https://github.com/actions/runner/issues/409#issuecomment-727565588 | |
cancel-in-progress: true | |
jobs: | |
eslint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: ./.github/workflows/setup-workspace | |
- run: pnpm run lint | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
message: "chore: linter autofixes" | |
default_author: github_actions | |
percy-instructions: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Comment with percy instructions | |
uses: bubkoo/auto-comment@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
pullRequestOpened: > | |
# Percy Screenshots | |
In order to conserve our percy screenshot allowance, percy is not configured to run automatically. Please make sure the PR is ready and all other checks are passing, then start it manually: | |
1. Visit https://github.com/UCLALibrary/ftva-website-nuxt/actions/workflows/percy.yml | |
2. Click the 'Run workflow' button in the blue bar. | |
3. Select the correct branch for this PR and click 'Run workflow' again to confirm. | |
nuxt: | |
name: Nuxt build / Cypress tests / Netlify deploy | |
runs-on: ubuntu-latest | |
timeout-minutes: 40 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/workflows/setup-workspace | |
- name: Set deployment date | |
id: set-deploy-date | |
run: echo "DEPLOY_DATE=$(date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV | |
- name: Cache built static site | |
uses: actions/cache@v3 | |
id: cache-nuxt3 | |
with: | |
path: .output/public | |
key: nuxt3-site-${{ github.sha }} | |
- name: Sets env vars for PR preview | |
run: | | |
echo "ES_ALIAS=${{secrets.ES_ALIAS_TEST}}-deploy-preview-${{github.event.pull_request.number}}" >> $GITHUB_ENV | |
if: github.ref_name!='main' | |
- name: Sets env vars for main merge | |
run: | | |
echo "ES_ALIAS=${{secrets.ES_ALIAS_TEST}}" >> $GITHUB_ENV | |
if: github.ref_name=='main' | |
- run: pnpm run generate | |
if: steps.cache-nuxt3.outputs.cache-hit != 'true' | |
env: | |
CRAFT_ENDPOINT: ${{ secrets.CRAFT_ENDPOINT_TEST }} | |
S3_BUCKET: "https://static.library.ucla.edu/" | |
SITEMAP_HOST: "https://test-ftva.library.ucla.edu" | |
ES_URL: ${{ secrets.ES_URL }} | |
ESApiKey: ${{ secrets.ESApiKey }} | |
ES_READ_KEY: ${{ secrets.ES_READ_KEY_TEST }} | |
ES_WRITE_KEY: ${{ secrets.ES_WRITE_KEY_TEST }} | |
ES_ALIAS: ${{ env.ES_ALIAS }} | |
ES_INDEX_PREFIX: ${{secrets.ES_INDEX_PREFIX_TEST}} | |
- name: Deploy to Netlify (preview) | |
if: github.ref_name!='main' | |
uses: nwtgck/[email protected] # | |
with: | |
production-deploy: false | |
deploy-message: | | |
Deploy preview for PR #${{ github.event.pull_request.number }}: Date: ${{ env.DEPLOY_DATE }} | |
Commit ${{ github.event.pull_request.head.sha }} - https://github.com/UCLALibrary/library-website-nuxt/commit/${{ github.event.pull_request.head.sha }} | |
Pull Request: https://github.com/UCLALibrary/library-website-nuxt/pull/${{ github.event.pull_request.number }} | |
alias: deploy-preview-${{ github.event.pull_request.number }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
overwrites-pull-request-comment: true | |
publish-dir: .output/public | |
fails-without-credentials: true | |
github-deployment-environment: ${{ github.event_name }}-${{ github.event.number }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_TEST_FTVA_SITE_ID }} | |
# Install Cypress binary explicitly to ensure it's available | |
- name: Install Cypress | |
run: npx cypress install | |
- uses: cypress-io/github-action@v3 | |
with: | |
start: pnpm dlx serve .output/public | |
install: false # Skip automatic install | |
wait-on: http://127.0.0.1:3000 | |
wait-on-timeout: 110 | |
env: | |
CRAFT_ENDPOINT: ${{ secrets.CRAFT_ENDPOINT_TEST }} | |
S3_BUCKET: "https://static.library.ucla.edu/" | |
SITEMAP_HOST: "https://test-ftva.library.ucla.edu" | |
ES_URL: ${{ secrets.ES_URL }} | |
ESApiKey: ${{ secrets.ESApiKey }} | |
ES_READ_KEY: ${{ secrets.ES_READ_KEY_TEST }} | |
ES_WRITE_KEY: ${{ secrets.ES_WRITE_KEY_TEST }} | |
ES_INDEX_PREFIX: ${{secrets.ES_INDEX_PREFIX_TEST}} | |
- name: Deploy to Netlify (test) | |
if: github.ref_name=='main' | |
uses: nwtgck/actions-netlify@v2 # | |
with: | |
production-deploy: true | |
deploy-message: "Deploy to test on merge to main Date: ${{ env.DEPLOY_DATE }} for commit ${{ github.sha }}: https://github.com/UCLALibrary/library-website-nuxt/commit/${{ github.sha }}" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
publish-dir: .output/public | |
fails-without-credentials: true | |
github-deployment-environment: testing | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_TEST_FTVA_SITE_ID }} | |