chore: Fix failing workflow. #34
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: Build & Deploy | |
# Controls when the action will run | |
on: | |
# Trigger the workflow on all pushes, except on tag creation | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
# Allow workflow to be dispatched on demand | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build & Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Node.js 🔨 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache 💾 | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-npm | |
with: | |
path: | | |
~/.npm | |
~/.cache | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} | |
- name: Install 📦 | |
run: npm ci --legacy-peer-deps | |
- name: Setup 📢 | |
env: | |
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} | |
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }} | |
GA4_MEASUREMENT_ID: ${{ secrets.GA4_MEASUREMENT_ID }} | |
OBJECT2VR_PLAYER: ${{ secrets.OBJECT2VR_PLAYER }} | |
RECAPTCHA_SITE_KEY: ${{ secrets.RECAPTCHA_SITE_KEY }} | |
run: | | |
echo GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY > .env | |
echo GOOGLE_ANALYTICS_ID=$GOOGLE_ANALYTICS_ID >> .env | |
echo GA4_MEASUREMENT_ID=$GA4_MEASUREMENT_ID >> .env | |
echo OBJECT2VR_PLAYER=$OBJECT2VR_PLAYER >> .env | |
echo RECAPTCHA_SITE_KEY=$RECAPTCHA_SITE_KEY >> .env | |
- name: Test ✅ | |
run: npm run ci-test | |
- name: Summary 📝 | |
if: always() | |
run: | | |
cat test-results.md >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
cat CYPRESS_RESULTS.md >> $GITHUB_STEP_SUMMARY | |
- name: Build ⚙️ | |
if: github.ref == 'refs/heads/main' | |
run: npm run build | |
- name: Deploy 🚀 | |
if: github.ref == 'refs/heads/main' | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
command: pages publish --project-name=dvuckovic-com --commit-dirty=true dist |