From 221049ef7dd8ca2bf6181dfa4d3613ccc8eeed05 Mon Sep 17 00:00:00 2001 From: Scott Henderson Date: Thu, 14 Mar 2024 16:43:39 -0700 Subject: [PATCH] Bump all actions versions and use ubuntu latest runners (#150) * bump all actions versions, ubuntu latest * fix bash wildcards for subfolders --- .github/actions/buildresources/action.yaml | 4 +- .github/workflows/binder-badge.yaml | 38 ------------------ .github/workflows/build_website.yaml | 6 +-- .github/workflows/deploy.yaml | 5 +-- .github/workflows/manual.yaml | 8 ++-- .github/workflows/netlifypreview.yaml | 6 +-- .github/workflows/qaqc.yaml | 2 +- .github/workflows/repo2docker-PR.yaml | 30 -------------- .github/workflows/repo2docker.yaml | 46 ---------------------- 9 files changed, 15 insertions(+), 130 deletions(-) delete mode 100644 .github/workflows/binder-badge.yaml delete mode 100644 .github/workflows/repo2docker-PR.yaml delete mode 100644 .github/workflows/repo2docker.yaml diff --git a/.github/actions/buildresources/action.yaml b/.github/actions/buildresources/action.yaml index 6e11aa0..3e7fba1 100644 --- a/.github/actions/buildresources/action.yaml +++ b/.github/actions/buildresources/action.yaml @@ -21,7 +21,7 @@ runs: steps: - name: Setup JupyterBook Cache if: inputs.jb-cache == 'true' - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ./book/_build # NOTE: change key to "jupyterbook-N+1" to force rebuilding cache @@ -52,7 +52,7 @@ runs: - name: Save Build if: ${{ always() && inputs.jb-save == 'true'}} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build path: book/_build/ diff --git a/.github/workflows/binder-badge.yaml b/.github/workflows/binder-badge.yaml deleted file mode 100644 index a4890f3..0000000 --- a/.github/workflows/binder-badge.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: AddBinderBadge -# https://github.com/jupyterhub/repo2docker-action#cache-builds-on-mybinderorg-and-provide-a-link -on: - pull_request: - types: [opened, reopened] - paths: - - 'book/tutorials/**' - - '.github/workflows/binder-badge.yml' - - 'conda/**' -jobs: - add-badge: - runs-on: ubuntu-20.04 - steps: - - name: Checkout PR - uses: actions/checkout@v3 - - - name: cache binder build on mybinder.org - uses: jupyterhub/repo2docker-action@master - with: - NO_PUSH: true - MYBINDERORG_TAG: ${{ github.event.pull_request.head.ref }} - - - name: Comment on PR with Binder link - uses: actions/github-script@v3 - env: - BRANCH_NAME: ${{ github.event.pull_request.head.ref }} - CONTENT_REPO: ${{github.event.pull_request.head.repo.full_name}} - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - var BRANCH_NAME = process.env.BRANCH_NAME; - var CONTENT_REPO = process.env.CONTENT_REPO; - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${context.repo.owner}/${context.repo.repo}/${BRANCH_NAME}) :point_left: Launch a binder notebook on this branch` - }) diff --git a/.github/workflows/build_website.yaml b/.github/workflows/build_website.yaml index 3c47cfe..31d1610 100644 --- a/.github/workflows/build_website.yaml +++ b/.github/workflows/build_website.yaml @@ -8,9 +8,9 @@ on: pull_request_target: types: [labeled, synchronize] paths: - - '.github/**' + - '.github/**/*' - '{{ cookiecutter.repo_directory }}/**' - - 'book/**' + - 'book/**/*' - 'conda/**' - 'scripts/**' - 'cookiecutter.yaml' @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 90e29d1..4934557 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -7,7 +7,6 @@ on: - '{{ cookiecutter.repo_directory }}/**' - 'scripts/**' - '.github/workflows/deploy.yaml' - - '.github/actions/**' - 'cookiecutter.yaml' branches: @@ -15,11 +14,11 @@ on: jobs: build-and-deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure NASA Earthdata Login continue-on-error: true diff --git a/.github/workflows/manual.yaml b/.github/workflows/manual.yaml index ef1ebb1..64ef007 100644 --- a/.github/workflows/manual.yaml +++ b/.github/workflows/manual.yaml @@ -5,12 +5,12 @@ on: jobs: build-and-test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 - + uses: actions/checkout@v4 + - name: Configure NASA Earthdata Login continue-on-error: true env: @@ -19,7 +19,7 @@ jobs: run: | echo "machine urs.earthdata.nasa.gov login $EARTHDATA_USER password $EARTHDATA_PASS" > ~/.netrc chmod 0600 ~/.netrc - + - uses: ./.github/actions/buildresources with: jb-cache: false diff --git a/.github/workflows/netlifypreview.yaml b/.github/workflows/netlifypreview.yaml index 09b381a..3f9eea5 100644 --- a/.github/workflows/netlifypreview.yaml +++ b/.github/workflows/netlifypreview.yaml @@ -6,14 +6,14 @@ on: jobs: add-preview: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest # This workflow accesses secrets and checks out a PR, so only run if labelled # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ if: contains(github.event.pull_request.labels.*.name, 'preview') steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} @@ -34,7 +34,7 @@ jobs: - name: Deploy Website Preview if: always() - uses: nwtgck/actions-netlify@v2.0 + uses: nwtgck/actions-netlify@v3.0 with: publish-dir: './book/_build/html' production-deploy: false diff --git a/.github/workflows/qaqc.yaml b/.github/workflows/qaqc.yaml index b2920c0..87d0160 100644 --- a/.github/workflows/qaqc.yaml +++ b/.github/workflows/qaqc.yaml @@ -7,7 +7,7 @@ on: jobs: quality-control: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: shell: bash -l {0} diff --git a/.github/workflows/repo2docker-PR.yaml b/.github/workflows/repo2docker-PR.yaml deleted file mode 100644 index 8261ddc..0000000 --- a/.github/workflows/repo2docker-PR.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Repo2DockerPR -on: - pull_request: - branches: - - main - paths: - - 'conda/**' - -jobs: - build-image: - runs-on: ubuntu-20.04 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get CalenderVersion UTC Date - id: calver - run: echo "::set-output name=version::$(date +'%Y.%m.%d')" - - - name: Repo2Docker - uses: jupyterhub/repo2docker-action@master - with: - NO_PUSH: true - IMAGE_NAME: pull-request - - - name: Report Image Size and Conda Packages - if: always() - run: | - docker images - docker run ${{secrets.DOCKER_IMAGE}}:latest conda list --export diff --git a/.github/workflows/repo2docker.yaml b/.github/workflows/repo2docker.yaml deleted file mode 100644 index 495200a..0000000 --- a/.github/workflows/repo2docker.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: Repo2Docker -on: - push: - branches: - - main - paths: - - 'conda/**' - -jobs: - build-image-and-push: - runs-on: ubuntu-20.04 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get CalenderVersion UTC Date - id: calver - run: echo "::set-output name=version::$(date +'%Y.%m.%d')" - - - name: Build and Push to DockerHub - uses: jupyterhub/repo2docker-action@master - with: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - IMAGE_NAME: ${{ secrets.DOCKER_IMAGE }} - ADDITIONAL_TAG: ${{ steps.calver.outputs.version }} - MYBINDERORG_TAG: ${{ github.event.ref }} # This builds the container on mybinder.org - - - name: Also Push To quay.io - id: push-to-quay - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ secrets.DOCKER_IMAGE }} - tags: ${{ steps.calver.outputs.version }} - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Print image url - run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" - - - name: Report Image Size and Conda Packages - if: always() - run: | - docker images - docker run ${{secrets.DOCKER_IMAGE}}:latest conda list --export