Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions .github/workflows/deploy-main-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:

jobs:
detect-repo-owner:
name: Detect branch and appropriate server
if: github.repository_owner == 'opencast'
runs-on: ubuntu-latest
outputs:
Expand All @@ -36,6 +37,7 @@ jobs:


deploy-main-branches:
name: Deploy editor.opencast.org
runs-on: ubuntu-latest
needs: detect-repo-owner
steps:
Expand Down Expand Up @@ -131,7 +133,7 @@ jobs:
run: |
git clone -b ${{ github.ref_name }} "git@github.com:${{ github.repository_owner }}/opencast.git" opencast
cd opencast
git checkout -b t/editor-$GITHUB_REF
git checkout -b t/editor-${{ needs.detect-repo-owner.outputs.branch }}

- name: Update the editor submodule
working-directory: opencast
Expand All @@ -142,17 +144,24 @@ jobs:
# could end up causing the commit message, and the actual submodule hash to differ.
git submodule update --init --remote modules/editor
git add modules/editor
git commit -m "Updating editor to $GITHUB_REF"
git push origin t/editor-$GITHUB_REF
git commit -m "Updating editor to ${{ github.sha }}"
# This token is an account wide token which allows creation of PRs and pushes.
echo "${{ secrets.MODULE_PR_TOKEN }}" > token.txt
gh auth login --with-token < token.txt
gh pr create \
--title "Update ${{ needs.detect-repo-owner.outputs.branch }} Editor to $GITHUB_REF" \
--body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Editor module to [$GITHUB_REF](https://github.com/${{ github.repository_owner }}/editor/commit/$GITHUB_REF)" \
--head=${{ github.repository_owner }}:t/editor-$GITHUB_REF \
--base ${{ github.ref_name }} \
-R ${{ github.repository_owner }}/opencast
#FIXME: fine grained PATs can't apply labels
#FIXME: classic PATs don't have the permissions because the PR isn't in an opencastproject (the user) repo
#--label editor --label maintenance \
export CURRENT_PR=$(gh pr list -R ${{ github.repository_owner }}/opencast --head t/editor-${{ needs.detect-repo-owner.outputs.branch }} --json number --jq '.[].number')
git push origin t/editor-${{ needs.detect-repo-owner.outputs.branch }} --force
if [ -n "$CURRENT_PR" ]; then
gh pr edit $CURRENT_PR \
--body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Editor module to [${{ github.sha }}](https://github.com/${{ github.repository_owner }}/editor/commit/${{ github.sha }})" \
-R ${{ github.repository_owner }}/opencast
else
gh pr create \
--title "Update ${{ needs.detect-repo-owner.outputs.branch }} Editor" \
--body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Editor module to [${{ github.sha }}](https://github.com/${{ github.repository_owner }}/editor/commit/${{ github.sha }})" \
--head=${{ github.repository_owner }}:t/editor-${{ needs.detect-repo-owner.outputs.branch }} \
--base ${{ github.ref_name }} \
-R ${{ github.repository_owner }}/opencast
#FIXME: fine grained PATs can't apply labels
#FIXME: classic PATs don't have the permissions because the PR isn't in an opencastproject (the user) repo
#--label editor --label maintenance \
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Opencast Video Editor
=====================

asdf
[![Build & Deploy](https://github.com/opencast/opencast-editor/workflows/Build%20&%20Deploy/badge.svg)
](https://github.com/opencast/opencast-editor/actions?query=workflow%3A%22Build+%26+Deploy%22)
[![Demo deployment](https://img.shields.io/badge/demo-editor.opencast.org-blue)
Expand Down
Loading