-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from kelseymorsebrown/fix-redirect
Fix redirect and failing unit tests
- Loading branch information
Showing
8 changed files
with
109 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Deploy to GitHub Pages | ||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
branches: | ||
- 'releases/**' | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: false | ||
jobs: | ||
test: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run tests | ||
run: npm run test | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build project | ||
env: | ||
CI: true | ||
REACT_APP_CLIENT_ID: ${{ secrets.API_CLIENT_ID }} | ||
run: npx --no-install npm run build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: ./build | ||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: https://kelseymorsebrown.github.io/jammming/ | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Run Unit Tests | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: false | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run tests | ||
env: | ||
REACT_APP_CLIENT_ID: ${{ secrets.API_CLIENT_ID }} | ||
run: npm run test |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
export const CLIENT_ID = process.env.REACT_APP_CLIENT_ID; | ||
export const REDIRECT_URI = 'http://localhost:3000/callback'; | ||
export const REDIRECT_URI = | ||
process.env.NODE_ENV === 'production' | ||
? 'https://kelseymorsebrown.github.io/jammming/callback' | ||
: 'http://localhost:3000/callback'; |