-
-
Notifications
You must be signed in to change notification settings - Fork 28
80 lines (69 loc) · 2.77 KB
/
make-live.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Make Live Notebooks
# Make live versions of .Rmd files in training modules and optionally rerender notebooks
# This workflow only runs when it is manually dispatched
on:
workflow_dispatch:
inputs:
rendering:
description: Should rendering be completed? TRUE or FALSE
required: true
default: "TRUE"
jobs:
make-live:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: ccdl/training_rstudio:edge
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
- name: Configure git
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
- name: Load 1Password secrets
uses: 1password/load-secrets-action@v2
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TRAINING_OP_SERVICE_ACCOUNT_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.OP_TRAINING_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OP_TRAINING_SECRET_ACCESS_KEY }}
DOCS_BOT_GITHUB_TOKEN: ${{ secrets.OP_DOCS_BOT_GITHUB_TOKEN }}
- name: Download data from S3
if: github.event.inputs.rendering == 'TRUE'
env:
AWS_DEFAULT_REGION: us-east-1
run: |
aws s3 sync s3://ccdl-training-data/training-modules/ .
- name: Render notebooks
env:
RENDER_RMD: ${{ github.event.inputs.rendering }}
run: bash scripts/render-live.sh
# Make changes to pull request here
- name: Create PR with rendered notebooks
uses: peter-evans/create-pull-request@v6
with:
token: ${{ env.DOCS_BOT_GITHUB_TOKEN }}
commit-message: Live and rendered notebooks
signoff: false
branch: auto_render_live
delete-branch: true
title: "GHA: Automated live (rendered) versions of the notebooks"
body: |
### Description:
This PR auto-generated from github actions running make-live.R with:
- The latest notebooks on the master branch
- The latest docker image on Dockerhub
### Instruction for reviewers:
Make sure that all the notebooks have been made into `_live` versions appropriately and have the updates you expect.
labels: |
automated
reviewers: $GITHUB_ACTOR
# Write PR info
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"