-
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.
- Loading branch information
cletqui
committed
Jun 17, 2024
1 parent
f1c8e3b
commit 7e034d5
Showing
6 changed files
with
94 additions
and
38 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 |
---|---|---|
@@ -1,51 +1,46 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static content to Pages | ||
name: Deploy project to GitHub Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ['main'] | ||
branches: | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: 'pages' | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Node | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
- name: Build project | ||
run: npm run build | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
# Upload dist folder | ||
path: './dist' | ||
path: "./dist" | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export const getOctokitInstance = vi.fn(() => ({ | ||
repos: { | ||
get: vi | ||
.fn() | ||
.mockResolvedValue({ | ||
data: { id: 123, name: "mock-repo", full_name: "mockuser/mock-repo" }, | ||
}), | ||
listForUser: vi | ||
.fn() | ||
.mockResolvedValue({ | ||
data: [{ id: 123, name: "mock-repo", full_name: "mockuser/mock-repo" }], | ||
}), | ||
}, | ||
})); | ||
|
||
export const verifyToken = vi.fn((token: string) => token === "valid-token"); | ||
export const getRandomRepository = vi | ||
.fn() | ||
.mockResolvedValue({ | ||
id: 123, | ||
name: "mock-repo", | ||
full_name: "mockuser/mock-repo", | ||
}); | ||
export const getRepository = vi | ||
.fn() | ||
.mockResolvedValue({ | ||
id: 123, | ||
name: "mock-repo", | ||
full_name: "mockuser/mock-repo", | ||
}); | ||
export const getMaxId = vi.fn().mockResolvedValue(815471592); |
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