fix functions solution #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Update episodes" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- literate | |
jobs: | |
generate-md-files: | |
runs-on: ubuntu-latest | |
outputs: | |
author: ${{ steps.author.outputs.author }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: 'literate' | |
- id: author | |
run: echo "author=$(git log -1 --pretty=format:'%aN <%aE>')" >> $GITHUB_OUTPUT | |
- uses: julia-actions/setup-julia@latest | |
with: | |
version: '1.9' | |
- uses: julia-actions/cache@v1 | |
- name: Run the generate script | |
shell: julia --project=@. --color=yes {0} | |
run: | | |
include(joinpath(pwd(), "generate.jl")) | |
- name: Upload output | |
uses: actions/upload-artifact@v3 | |
with: | |
name: output | |
path: output | |
move-files-to-main: | |
runs-on: ubuntu-latest | |
needs: generate-md-files | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: 'main' | |
- name: Download files | |
uses: actions/download-artifact@v3 | |
with: | |
name: output | |
path: output | |
- name: Move files | |
run: | | |
ls -RF | |
mv output/carpentries/*.md episodes | |
mv output/carpentries/code/* code | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
delete-branch: true | |
base: main | |
title: Update episodes from Literate.jl source files | |
add-paths: episodes | |
author: ${{ needs.generate-md-files.outputs.author }} | |