Skip to content

Build and Deploy to GitHub Pages #14

Build and Deploy to GitHub Pages

Build and Deploy to GitHub Pages #14

Workflow file for this run

name: Build and Deploy to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
REACT_APP_FIREBASE_API_KEY: ${{ secrets.REACT_APP_FIREBASE_API_KEY }}
REACT_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.REACT_APP_FIREBASE_AUTH_DOMAIN }}
REACT_APP_FIREBASE_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_PROJECT_ID }}
REACT_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.REACT_APP_FIREBASE_STORAGE_BUCKET }}
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.REACT_APP_FIREBASE_MESSAGING_SENDER_ID }}
REACT_APP_FIREBASE_APP_ID: ${{ secrets.REACT_APP_FIREBASE_APP_ID }}
REACT_APP_FIREBASE_MEASUREMENT_ID: ${{ secrets.REACT_APP_FIREBASE_MEASUREMENT_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Create env.json
run: |
echo '{
"REACT_APP_FIREBASE_API_KEY": "${{ secrets.REACT_APP_FIREBASE_API_KEY }}",
"REACT_APP_FIREBASE_AUTH_DOMAIN": "${{ secrets.REACT_APP_FIREBASE_AUTH_DOMAIN }}",
"REACT_APP_FIREBASE_PROJECT_ID": "${{ secrets.REACT_APP_FIREBASE_PROJECT_ID }}",
"REACT_APP_FIREBASE_STORAGE_BUCKET": "${{ secrets.REACT_APP_FIREBASE_STORAGE_BUCKET }}",
"REACT_APP_FIREBASE_MESSAGING_SENDER_ID": "${{ secrets.REACT_APP_FIREBASE_MESSAGING_SENDER_ID }}",
"REACT_APP_FIREBASE_APP_ID": "${{ secrets.REACT_APP_FIREBASE_APP_ID }}",
"REACT_APP_FIREBASE_MEASUREMENT_ID": "${{ secrets.REACT_APP_FIREBASE_MEASUREMENT_ID }}"
}' > public/env.json
- name: Build project
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: dataroom.fx.land