Skip to content

build and deploy Mapstery #38

build and deploy Mapstery

build and deploy Mapstery #38

name: build-and-deploy
run-name: build and deploy Mapstery
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/hydrogen
- name: "Install Dependencies"
run: npm ci
- name: "Run Tests"
run: npm test
env:
VITE_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
VITE_GEONAMES_USERNAME: ${{ secrets.GEONAMES_USERNAME }}
- name: "Create Production Build"
run: npm run build
env:
VITE_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
VITE_GEONAMES_USERNAME: ${{ secrets.GEONAMES_USERNAME }}
VITE_GEONAMES_TOKEN: ${{ secrets.GEONAMES_TOKEN }}
VITE_POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
- uses: actions/upload-artifact@v4
with:
name: mapstery-production-build
path: ./dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: mapstery-production-build
path: ./dist
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_PAGES_DEPLOYMENT }}
publish_dir: ./dist