From 4d586c244ea96bcdcfbd3db0f69699346ac421b1 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 16 Aug 2022 16:54:10 +0200 Subject: [PATCH] GHA: Compile from branch --- .github/workflows/main.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 02ec9327..d2da3a1c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,16 +28,14 @@ jobs: poetry install -E ghp-compiled - name: Compile the courses run: | - for slug in pyladies mi-pyt meta lessons; do - poetry run python -m naucse_render compile _compiled/$slug --slug $slug \ + poetry run python -m naucse_render compile _compiled \ --edit-repo-url https://github.com/${{ github.repository }} \ - --edit-repo-branch main - done - - if: ${{ github.ref == 'refs/heads/main' }} + --edit-repo-branch ${{ github.ref_name }} + - if: ${{ startsWith(github.ref, 'refs/heads/') }} name: Publish compiled courses run: | - git fetch origin compiled || : - poetry run python -m ghp_import -m "Compiled" -b compiled --push _compiled/ + git fetch origin compiled/${{ github.ref_name }} || : + poetry run python -m ghp_import -m "Compiled" -b compiled/${{ github.ref_name }} --push _compiled/ curl -H 'Content-Type: application/json' \ --data '{"repository": "https://github.com/${{ github.repository }}", "branch": "compiled"}' \ https://hooks.nauc.se/trigger