Skip to content
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

Switch GitHub Pages deployment method/source to GitHub Actions #325

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
types: [opened, synchronize]

jobs:
documentation:
build-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -55,13 +55,22 @@ jobs:
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EDL_PASSWORD }}

- name: Deploy
if: |
github.event_name == 'push'
&& (github.ref == 'refs/heads/main' || github.ref == 'ref/heads/documentation')
&& github.repository == 'nsidc/earthaccess'
uses: peaceiris/actions-gh-pages@v3
- name: Upload site artifact
uses: actions/upload-pages-artifact@v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a v2 release for this action (and the deploy-pages@ one too). Any reason to use v1 over v2?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, was just lack of awareness and copy/pasting :)

with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
path: ./site

deploy-documentation:
if: |
github.event_name == 'push'
&& (github.ref == 'refs/heads/main' || github.ref == 'ref/heads/documentation')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the documentation branch coming from?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, honestly. It was based on stuff that was already here. @betolink ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah, originally I was thinking about having that branch to test changes to the docs without having to deploy main.

&& github.repository == 'nsidc/earthaccess'
runs-on: ubuntu-latest
needs: build-documentation
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
Loading