-
Notifications
You must be signed in to change notification settings - Fork 0
Deploy current main to GitHub Pages automatically #72
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||||
| name: Deploy GitHub Pages | ||||||||
|
|
||||||||
| on: | ||||||||
| push: | ||||||||
| branches: | ||||||||
| - main | ||||||||
| workflow_dispatch: | ||||||||
|
|
||||||||
| permissions: | ||||||||
| contents: read | ||||||||
| pages: write | ||||||||
| id-token: write | ||||||||
|
|
||||||||
| concurrency: | ||||||||
| group: pages | ||||||||
| cancel-in-progress: false | ||||||||
|
|
||||||||
| jobs: | ||||||||
| deploy: | ||||||||
| runs-on: ubuntu-latest | ||||||||
| environment: | ||||||||
| name: github-pages | ||||||||
| url: ${{ steps.deployment.outputs.page_url }} | ||||||||
|
|
||||||||
| steps: | ||||||||
| - name: Checkout | ||||||||
| uses: actions/checkout@v7 | ||||||||
|
|
||||||||
| - name: Setup Node.js | ||||||||
| uses: actions/setup-node@v7 | ||||||||
| with: | ||||||||
| node-version: 24 | ||||||||
| cache: npm | ||||||||
|
|
||||||||
| - name: Install dependencies | ||||||||
| run: npm ci | ||||||||
|
|
||||||||
| - name: Run tests | ||||||||
| run: npm run test | ||||||||
|
Comment on lines
+37
to
+39
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Tests are run with the ci workflow before a PR is merged, no? |
||||||||
|
|
||||||||
| - name: Build | ||||||||
| run: npm run build | ||||||||
|
|
||||||||
| - name: Validate metadata files | ||||||||
| run: npm run validate:metadata | ||||||||
|
|
||||||||
|
Comment on lines
+44
to
+46
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this is also part of the ci workflow. |
||||||||
| - name: Configure Pages | ||||||||
| uses: actions/configure-pages@v5 | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| - name: Upload Pages artifact | ||||||||
| uses: actions/upload-pages-artifact@v4 | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| with: | ||||||||
| path: dist | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| - name: Deploy Pages | ||||||||
| id: deployment | ||||||||
| uses: actions/deploy-pages@v4 | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -92,6 +92,15 @@ npm exec -- zenodraft metadata validate .zenodo.json | |||||
|
|
||||||
| During export, OpenCite validates generated `.zenodo.json` metadata. ZIP exports include `METADATA_VALIDATION.txt` for downstream provenance checks. | ||||||
|
|
||||||
| ### GitHub Pages deployment | ||||||
|
|
||||||
| The `Deploy GitHub Pages` workflow runs on every push to `main` (and can be run | ||||||
| manually). It installs dependencies, runs tests and metadata validation, builds | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Following their removal. Since we have branch protections, there is no push to main without a PR first; tests and metadata validation are run with the PRs, so no need to run again. |
||||||
| the Vite site, and publishes `dist` to GitHub Pages. In the repository's | ||||||
| **Settings > Pages**, select **GitHub Actions** as the build and deployment | ||||||
| source. This replaces the previous `gh-pages` branch publishing setup; keep | ||||||
| that branch until the first workflow deployment succeeds. | ||||||
|
|
||||||
| ## GitHub Import Workflow | ||||||
|
|
||||||
| 1. Paste a GitHub repository URL into the import field. | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of multiple PRs coming in.