Skip to content

Merge pull request #127 from inbo/docker-renv-update #56

Merge pull request #127 from inbo/docker-renv-update

Merge pull request #127 from inbo/docker-renv-update #56

name: On merge of protocol branch to main, build the protocol and add it to the website
on:
push:
branches:
- main
jobs:
build-website:
runs-on: ubuntu-latest
name: "add protocol to website"
steps:
- name: checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get branch name of latest merged PR targeting main
run: |
RECENT_MERGED_BRANCH_NAME=$(git log --merges origin/main --oneline --grep='^Merge' -1 | grep -oe 'inbo/.*$' | awk -F '/' '{print $2}')
echo "RECENT_MERGED_BRANCH_NAME=$RECENT_MERGED_BRANCH_NAME" >> $GITHUB_ENV
- name: test
run: echo 'branch name =' $RECENT_MERGED_BRANCH_NAME
- name: Checkout repo and build website
if: (startsWith(env.RECENT_MERGED_BRANCH_NAME, 'sfp-')
|| startsWith(env.RECENT_MERGED_BRANCH_NAME, 'sip-')
|| startsWith(env.RECENT_MERGED_BRANCH_NAME, 'sop-')
|| startsWith(env.RECENT_MERGED_BRANCH_NAME, 'sap-')
|| startsWith(env.RECENT_MERGED_BRANCH_NAME, 'spp-'))
uses: inbo/actions/protocol_website@main
with:
PAT: ${{ secrets.PAT }}
GITHUB_REPOSITORY_DEST: "inbo/protocols"
RECENT_MERGED_BRANCH_NAME: $RECENT_MERGED_BRANCH_NAME