-
Notifications
You must be signed in to change notification settings - Fork 113
Bump GitHub Actions #260
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
Merged
Merged
Bump GitHub Actions #260
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
321d294
update actions steps
scottyhq 5132e32
update actions steps
scottyhq 8346f54
add failOnError
scottyhq a547ed9
follow docs
scottyhq d11d734
new approach
scottyhq f8af161
cleanup
scottyhq 0f7d3db
ci: Update SURGE_TOKEN to be accesed via env
lsetiawan ebee2a7
ci: Change preview to use pull_request_target
lsetiawan cf65eab
use workflow_run for surge preview
scottyhq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,10 +1,11 @@ | ||
# Regularly update Docker tags and Actions steps | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/.devcontainer" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "github-actions" | ||
directory: "/.github" | ||
- package-ecosystem: "github-actions" | ||
directory: "/.github" | ||
schedule: | ||
interval: "monthly" |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,53 @@ | ||
name: Pull Request Build | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
preview: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
steps: | ||
- name: Checkout repository | ||
if: github.event.action != 'closed' | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup JupyterBook Cache | ||
if: github.event.action != 'closed' | ||
uses: actions/cache@v4 | ||
with: | ||
path: _build | ||
# NOTE: change key to "jupyterbook-DATE" to force rebuilding cache | ||
key: jupyterbook-20240517 | ||
|
||
- name: Install Conda environment with Micromamba | ||
if: github.event.action != 'closed' | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: conda/conda-lock.yml | ||
environment-name: xarray-tutorial | ||
cache-environment: true | ||
|
||
- name: Build JupyterBook | ||
if: github.event.action != 'closed' | ||
run: | | ||
jupyter-book build ./ --warningiserror --keep-going | ||
|
||
- name: Dump Build Logs | ||
if: github.event.action != 'closed' | ||
run: | | ||
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi | ||
|
||
- name: Upload artifact | ||
if: github.event.action != 'closed' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: html | ||
path: book/_build/html |
This file contains hidden or 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 hidden or 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,42 @@ | ||
name: Pull Request Preview | ||
|
||
on: | ||
workflow_run: | ||
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. This only runs on the main branch, so need to merge to actually see it in action |
||
workflows: ["Pull Request Build"] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
pull-requests: write # allow surge-preview to create/update PR comments | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.workflow_run.id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# NOTE: match job name in pull_request.yaml | ||
preview: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} | ||
|
||
steps: | ||
# Ensure folder exists for PR 'closed' case | ||
- run: mkdir html | ||
|
||
# Download built HTML from PR Build workflow | ||
- uses: actions/download-artifact@v4 | ||
continue-on-error: true | ||
with: | ||
github-token: ${{ github.token }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
|
||
- name: Manage Surge.sh Deployment | ||
id: preview_step | ||
uses: afc163/surge-preview@v1 | ||
with: | ||
surge_token: ${{ secrets.SURGE_TOKEN }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
build: echo 'Uploading html/ folder contents to Surge.sh...' | ||
dist: html # NOTE: match upload_artifact name in pull_request.yaml | ||
failOnError: true | ||
teardown: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.