|
| 1 | +# GitHub Actions Workflows |
| 2 | + |
| 3 | +This directory contains automated workflows for maintaining the website and CV. |
| 4 | + |
| 5 | +## Workflows |
| 6 | + |
| 7 | +### 1. Quarto Publish (`quarto-publish.yml`) |
| 8 | + |
| 9 | +**Purpose**: Automatically builds and deploys the Quarto website to GitHub Pages. |
| 10 | + |
| 11 | +**Triggers**: |
| 12 | +- Push to `main` branch |
| 13 | +- Manual trigger via workflow_dispatch |
| 14 | + |
| 15 | +**What it does**: |
| 16 | +1. Sets up R environment and dependencies |
| 17 | +2. Installs Quarto |
| 18 | +3. Renders the website |
| 19 | +4. Publishes to gh-pages branch |
| 20 | + |
| 21 | +**Best Practices Implemented**: |
| 22 | +- Concurrency control prevents simultaneous deployments |
| 23 | +- 20-minute timeout prevents hanging jobs |
| 24 | +- Can be manually triggered if needed |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +### 2. Monthly CV Update (`update-cv.yml`) |
| 29 | + |
| 30 | +**Purpose**: Automatically updates CV with latest publications from ORCID. |
| 31 | + |
| 32 | +**Triggers**: |
| 33 | +- Scheduled: 1st day of every month at midnight UTC |
| 34 | +- Manual trigger via workflow_dispatch (important - see below!) |
| 35 | + |
| 36 | +**What it does**: |
| 37 | +1. Fetches latest publications from ORCID |
| 38 | +2. Updates `research/index.qmd` with publication list |
| 39 | +3. Updates `cv/resume.typ` with publications |
| 40 | +4. Compiles the CV to PDF using Typst |
| 41 | +5. Commits and pushes changes back to repository |
| 42 | + |
| 43 | +**Best Practices Implemented**: |
| 44 | +- Concurrency control prevents overlapping update runs |
| 45 | +- 30-minute timeout prevents hanging jobs |
| 46 | +- Error handling for missing ORCID_TOKEN |
| 47 | +- Retry logic for git push operations |
| 48 | +- Uses `[skip ci]` to prevent trigger loops |
| 49 | + |
| 50 | +**Requirements**: |
| 51 | +- `ORCID_TOKEN` must be set in repository secrets |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Important: GitHub's 60-Day Workflow Disable Policy |
| 56 | + |
| 57 | +⚠️ **CRITICAL INFORMATION ABOUT SCHEDULED WORKFLOWS** |
| 58 | + |
| 59 | +GitHub automatically **disables scheduled workflows** (like the Monthly CV Update) if: |
| 60 | +- There is **no repository activity for 60 days** |
| 61 | +- This includes no commits, no pull requests, no issues, etc. |
| 62 | + |
| 63 | +### Why This Happens |
| 64 | + |
| 65 | +When a repository is inactive for 60 days, GitHub assumes the project is dormant and disables all scheduled workflows to save resources. You'll receive an email notification when this occurs: |
| 66 | + |
| 67 | +> "The 'Monthly CV Update' workflow in username/repository has been disabled" |
| 68 | +
|
| 69 | +### How to Prevent Auto-Disable |
| 70 | + |
| 71 | +You have several options: |
| 72 | + |
| 73 | +1. **Manual Trigger (Recommended)**: |
| 74 | + - Visit: Actions → Monthly CV Update → Run workflow |
| 75 | + - This counts as repository activity and resets the 60-day timer |
| 76 | + - Run this every ~50 days (just over 7 weeks) if you're not actively committing to provide a safety margin |
| 77 | + |
| 78 | +2. **Make Regular Commits**: |
| 79 | + - Any commit to the repository resets the timer |
| 80 | + - The workflow itself commits changes when publications update |
| 81 | + |
| 82 | +3. **Keep-Alive Workflow** (Not Implemented): |
| 83 | + - Could add a separate workflow that commits a timestamp file every 50 days |
| 84 | + - Decided against this to avoid polluting git history |
| 85 | + |
| 86 | +### How to Re-Enable After Disable |
| 87 | + |
| 88 | +If the workflow gets disabled: |
| 89 | + |
| 90 | +1. Go to the **Actions** tab in your repository |
| 91 | +2. Click on "**Monthly CV Update**" in the left sidebar |
| 92 | +3. Click the "**Enable workflow**" button |
| 93 | +4. Optionally, click "**Run workflow**" to trigger it immediately |
| 94 | + |
| 95 | +### Monitoring |
| 96 | + |
| 97 | +- Check your email for GitHub notifications |
| 98 | +- Visit the Actions tab periodically to verify workflows are enabled |
| 99 | +- The workflow_dispatch trigger ensures you can always run it manually |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Secrets Required |
| 104 | + |
| 105 | +The following secrets must be configured in repository settings: |
| 106 | + |
| 107 | +1. **ORCID_TOKEN**: Required for the Monthly CV Update workflow |
| 108 | + - Used to authenticate with ORCID API |
| 109 | + - Get from: https://orcid.org/developer-tools |
| 110 | + - Add via: Settings → Secrets and variables → Actions → New repository secret |
| 111 | + |
| 112 | +2. **GITHUB_TOKEN**: Automatically provided by GitHub |
| 113 | + - Used for pushing commits and deploying pages |
| 114 | + - No configuration needed |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## Manual Workflow Execution |
| 119 | + |
| 120 | +Both workflows can be manually triggered: |
| 121 | + |
| 122 | +1. Go to the **Actions** tab |
| 123 | +2. Select the workflow you want to run |
| 124 | +3. Click "**Run workflow**" |
| 125 | +4. Select the branch (usually `main`) |
| 126 | +5. Click "**Run workflow**" button |
| 127 | + |
| 128 | +This is useful for: |
| 129 | +- Testing changes to workflows |
| 130 | +- Forcing an update outside the schedule |
| 131 | +- Re-running after fixing an error |
| 132 | +- Resetting the 60-day inactivity timer |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +## Troubleshooting |
| 137 | + |
| 138 | +### Workflow Fails with "ORCID_TOKEN secret is not set" |
| 139 | + |
| 140 | +**Solution**: Add the ORCID_TOKEN secret: |
| 141 | +1. Go to Settings → Secrets and variables → Actions |
| 142 | +2. Click "New repository secret" |
| 143 | +3. Name: `ORCID_TOKEN` |
| 144 | +4. Value: Your ORCID API token |
| 145 | +5. Click "Add secret" |
| 146 | + |
| 147 | +### Workflow is Disabled |
| 148 | + |
| 149 | +**Cause**: No repository activity for 60 days |
| 150 | + |
| 151 | +**Solution**: See "How to Re-Enable After Disable" section above |
| 152 | + |
| 153 | +### Git Push Fails in CV Update |
| 154 | + |
| 155 | +**Cause**: Concurrent workflow runs or external commits |
| 156 | + |
| 157 | +**Solution**: The workflow includes retry logic. If it persists: |
| 158 | +1. Check for concurrent workflow runs |
| 159 | +2. Manually pull latest changes |
| 160 | +3. Re-run the workflow |
| 161 | + |
| 162 | +### Publications Not Updating |
| 163 | + |
| 164 | +**Possible causes**: |
| 165 | +1. ORCID profile not updated |
| 166 | +2. DOIs not in ORCID record |
| 167 | +3. Crossref API issues |
| 168 | + |
| 169 | +**Debug**: |
| 170 | +1. Check workflow logs in Actions tab |
| 171 | +2. Verify publications are in your ORCID profile |
| 172 | +3. Ensure DOIs are correct format |
| 173 | + |
| 174 | +--- |
| 175 | + |
| 176 | +## Maintenance |
| 177 | + |
| 178 | +### Updating Dependencies |
| 179 | + |
| 180 | +When updating action versions in workflows: |
| 181 | + |
| 182 | +1. Check the action's repository for breaking changes |
| 183 | +2. Test in a separate branch first |
| 184 | +3. Update version numbers gradually (don't skip major versions) |
| 185 | + |
| 186 | +### Modifying the Schedule |
| 187 | + |
| 188 | +To change the CV update frequency, edit the cron expression in `update-cv.yml`: |
| 189 | + |
| 190 | +```yaml |
| 191 | +schedule: |
| 192 | + - cron: '0 0 1 * *' # Current: Monthly on the 1st |
| 193 | + # Examples: |
| 194 | + # - cron: '0 0 * * 0' # Weekly on Sunday |
| 195 | + # - cron: '0 0 1 */3 *' # Quarterly (every 3 months) |
| 196 | +``` |
| 197 | + |
| 198 | +**Note**: More frequent schedules use more GitHub Actions minutes but help prevent the 60-day disable. |
| 199 | + |
| 200 | +--- |
| 201 | + |
| 202 | +## Additional Notes |
| 203 | + |
| 204 | +- All workflows use Ubuntu latest runners |
| 205 | +- R version is set to 'release' for stability |
| 206 | +- Quarto uses the latest version from quarto-dev |
| 207 | +- Typst is installed via the official setup action |
| 208 | +- Font Awesome is required for CV compilation |
0 commit comments