Skip to content

Commit

Permalink
Deploy to Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCode92 authored Jan 8, 2025
1 parent 88773df commit 28aacb2
Show file tree
Hide file tree
Showing 9 changed files with 16,091 additions and 2 deletions.
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

0 comments on commit 28aacb2

Please sign in to comment.