Skip to content

Commit

Permalink
add custom domain support
Browse files Browse the repository at this point in the history
  • Loading branch information
weisser-dev committed Jan 23, 2024
1 parent 9fe9af6 commit 0ff2e15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#PUBLIC_URL = "https://your.domain"
6 changes: 5 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ jobs:
- name: Build project
run: |
PUBLIC_URL="https://$(echo $GITHUB_REPOSITORY | awk -F / '{print tolower($1)}').github.io/$(echo $GITHUB_REPOSITORY | awk -F / '{print tolower($2)}')" npm run build
if ! grep -q "PUBLIC_URL" .env; then
PUBLIC_URL="https://$(echo $GITHUB_REPOSITORY | awk -F / '{print tolower($1)}').github.io/$(echo $GITHUB_REPOSITORY | awk -F / '{print tolower($2)}')"
echo "PUBLIC_URL=$PUBLIC_URL" >> $GITHUB_ENV
fi
npm run build
env:
GITHUB_REPOSITORY: ${{ github.repository }}
CI: false
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Feel free to fork this project and make it your own. Here's how to deploy your v
5. Deploy to your preferred service, like GitHub Pages (Works out of the box, just enable Actions and give them the correct permissions: Actions -> General -> Workflow -> Read and write permissions ).
6. Enable GH Pages -> Pages -> "Deploy from a branch" -> "gh-pages"
Happy sharing of your professional digital business card!

7. Pls also check, if you use a custom domain, that this is in the .env File as PUBLIC_URL
## Screenshots

### Mobile View
Expand Down

0 comments on commit 0ff2e15

Please sign in to comment.