Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to Netlify #30

Merged
merged 7 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
pull_request:
branches:
- main
env:
BRANCH_NAME: ${{ github.ref_name }}
jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,6 +38,15 @@ jobs:
build:
runs-on: ubuntu-latest
needs: test
environment: development
env:
VITE_CI: true
VITE_API_KEY: ${{vars.VITE_API_KEY}}
VITE_AUTH_DOMAIN: ${{vars.VITE_AUTH_DOMAIN}}
VITE_PROJECT_ID: ${{vars.VITE_PROJECT_ID}}
VITE_STORAGE_BUCKET: ${{vars.VITE_STORAGE_BUCKET}}
VITE_MESSAGING_SENDER_ID: ${{vars.VITE_MESSAGING_SENDER_ID}}
VITE_APP_ID: ${{vars.VITE_APP_ID}}
steps:
- name: Checkout the code
uses: actions/checkout@v4
Expand All @@ -54,6 +65,29 @@ jobs:
with:
name: dist-files
path: dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Get build artifacts
uses: actions/download-artifact@v4
with:
name: dist-files
path: ./dist
- name: Output files
working-directory: ./dist
run: ls -l
- name: Install Netlify CLI
run: npm install -g netlify-cli
- name: Deploy to Netlify
run: |
prod_flag=""
if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi
netlify deploy \
--dir dist \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_API_TOKEN }} \
$prod_flag
report:
runs-on: ubuntu-latest
needs: [lint, build]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ firebase/data
*.njsproj
*.sln
*.sw?

# Local Netlify folder
.netlify
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
cspell.json
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ignoreWords": ["tseslint", "tailwindcss", "testid", "svgr", "firestore"],
"ignoreWords": [
"tseslint", "tailwindcss", "testid", "svgr",
"firestore", "vite"
],
"words": ["crwn"]
}
Loading
Loading