Skip to content

Commit 14fd4cc

Browse files
authored
CI: Improve the docs workflow (#26)
1 parent 62faef8 commit 14fd4cc

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
# Check for updates to GitHub Actions on Tuesdays
10+
interval: "weekly"
11+
day: "tuesday"
12+
# Allow up to 2 open pull requests at a time
13+
open-pull-requests-limit: 2

.github/workflows/docs.yml

+16-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
name: Docs
55

66
on:
7-
# pull_request:
7+
pull_request:
8+
paths:
9+
- 'docs/**'
10+
- '.github/workflows/**'
811
push:
912
branches:
1013
- main
@@ -14,29 +17,27 @@ on:
1417

1518
jobs:
1619
build:
17-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-latest
1821
defaults:
1922
run:
2023
shell: bash -l {0}
2124

2225
steps:
23-
# Checks-out your repository under $GITHUB_WORKSPACE
2426
- name: Checkout
25-
uses: actions/checkout@v2.4.0
27+
uses: actions/checkout@v4.1.6
2628

27-
# Setup Miniconda
28-
- name: Setup Miniconda
29-
uses: conda-incubator/[email protected]
29+
- name: Get current week number of year
30+
id: date
31+
run: echo "date=$(date +%Y-W%W)" >> $GITHUB_OUTPUT # e.g., 2024-W19
32+
33+
- name: Setup Micromamba
34+
uses: mamba-org/[email protected]
3035
with:
31-
activate-environment: gmt-examples
3236
environment-file: environment.yml
33-
python-version: 3.9
34-
channels: conda-forge
35-
miniconda-version: "latest"
36-
37-
# Show installed pkg information for postmortem diagnostic
38-
- name: List installed packages
39-
run: conda list
37+
cache-downloads: false
38+
cache-environment: true
39+
# environment cache is persistent for one week.
40+
cache-environment-key: micromamba-environment-${{ steps.date.outputs.date }}
4041

4142
- name: Build the website
4243
run: make -C docs clean html

0 commit comments

Comments
 (0)