- batch update August 2023 (#201) #92
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: "Deploying website to GitHub Pages" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
name: "Deploying website to GitHub Pages" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Make envfile | |
run: | | |
echo 'VITE_CONTACT_FORM_URL="${{ secrets.VITE_CONTACT_FORM_URL }}"' > .env | |
echo 'VITE_CONTACT_FORM_EMAIL_NAME="${{ secrets.VITE_CONTACT_FORM_EMAIL_NAME }}"' >> .env | |
echo 'VITE_CONTACT_FORM_QUESTION_NAME="${{ secrets.VITE_CONTACT_FORM_QUESTION_NAME }}"' >> .env | |
echo 'VITE_MAPBOX_STYLE="${{ secrets.VITE_MAPBOX_STYLE }}"' >> .env | |
echo 'VITE_MAPBOX_TOKEN="${{ secrets.VITE_MAPBOX_TOKEN }}"' >> .env | |
- name: Install dependencies | |
run: | | |
npm install | |
npm run build | |
- name: Handle SEO & 404s | |
run: | | |
cp index.html 404.html | |
for page in about services career contact privacy company career/developer career/intern bubbles partnerships | |
do | |
mkdir $page | |
cp index.html $page/index.html | |
done | |
working-directory: dist | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: public | |
FOLDER: dist | |
CLEAN: true |