1- name : Publish Pull Request Page
1+ name : PRs » Publish Pull Request Page
22
33on :
44 pull_request_target :
@@ -11,8 +11,8 @@ concurrency:
1111 cancel-in-progress : false
1212
1313jobs :
14- detect :
15- if : ${{ github.event.pull_request.head.repo.full_name == 'opencast/opencast-admin-interface' }}
14+ detect-repo-owner :
15+ if : github.repository_owner == 'opencast'
1616 runs-on : ubuntu-latest
1717 outputs :
1818 server : ${{ steps.test-server.outputs.server }}
@@ -36,42 +36,42 @@ jobs:
3636 #Strip the r/ prefix, giving us just 17.x. If this is main/develop this does nothing
3737 echo "branch=${TEMP#r\/}" >> $GITHUB_OUTPUT
3838
39- main :
39+ deploy-pr :
4040 runs-on : ubuntu-latest
41- needs : detect
41+ needs : detect-repo-owner
4242 steps :
43- - name : generate build path
43+ - name : Generate build path
4444 run : echo "build=${{github.event.number}}/$(date +%Y-%m-%d_%H-%M-%S)/" >> $GITHUB_OUTPUT
4545 id : build-path
4646
47- - name : checkout code
47+ - name : Checkout sources
4848 uses : actions/checkout@v4
4949 with :
5050 ref : ${{github.event.pull_request.head.ref}}
5151 repository : ${{github.event.pull_request.head.repo.full_name}}
5252
53- - name : get node .js
53+ - name : Get Node .js
5454 uses : actions/setup-node@v4
5555 with :
5656 node-version : 20
5757
58- - name : download dependencies
58+ - name : Run npm ci
5959 run : npm ci
6060
61- - name : build app
61+ - name : Build the app
6262 run : |
6363 npm run build
6464 env :
65- VITE_TEST_SERVER_URL : ${{needs.detect.outputs.server}}
65+ VITE_TEST_SERVER_URL : ${{needs.detect-repo-owner .outputs.server}}
6666 NODE_ENV : development
6767 VITE_TEST_SERVER_AUTH : " admin:opencast"
6868
69- - name : prepare git
69+ - name : Prepare git
7070 run : |
7171 git config --global user.name "Admin Interface Deployment Bot"
7272 git config --global user.email "cloud@opencast.org"
7373
74- - name : prepare GitHub SSH key
74+ - name : Prepare GitHub SSH key from org level secret
7575 env :
7676 DEPLOY_KEY : ${{ secrets.DEPLOY_KEY_TEST }}
7777 run : |
@@ -80,18 +80,18 @@ jobs:
8080 chmod 600 ~/.ssh/id_ed25519
8181 ssh-keyscan github.com >> ~/.ssh/known_hosts
8282
83- - name : wait for previous workflows to finish
83+ - name : Wait for previous workflows to finish
8484 uses : softprops/turnstyle@v2
8585 with :
8686 same-branch-only : false
8787 env :
8888 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8989
90- - name : clone repository
90+ - name : Clone repository
9191 run : |
9292 git clone -b gh-pages "git@github.com:${{ github.repository_owner }}/opencast-admin-interface-test.git" admin-interface-test
9393
94- - name : store build
94+ - name : Store build in the clone
9595 env :
9696 DEPLOY_PATH : admin-interface-test/${{ steps.build-path.outputs.build }}
9797 run : |
@@ -108,7 +108,7 @@ jobs:
108108 rm -f cleanup-deployments.sh
109109 git add .
110110
111- - name : generate index.html
111+ - name : Generate index.html
112112 working-directory : admin-interface-test
113113 run : |
114114 echo '<html><body><ul>' > index.html
@@ -117,18 +117,18 @@ jobs:
117117 | sed 's/^\(.*\)$/<li><a href=\1>\1<\/a><\/li>/' >> index.html
118118 echo '</ul></body></html>' >> index.html
119119
120- - name : commit new version
120+ - name : Commit new version
121121 working-directory : admin-interface-test
122122 run : |
123123 git add .
124124 git commit --amend -m "Build ${{ steps.build-path.outputs.build }}"
125125
126- - name : push updates
126+ - name : Force push admin interface test branch
127127 working-directory : admin-interface-test
128128 run : |
129129 git push origin gh-pages --force
130130
131- - name : add comment with deployment location
131+ - name : Add comment with deployment location
132132 uses : thollander/actions-comment-pull-request@v3
133133 with :
134134 comment-tag : static-test-deployment
@@ -138,3 +138,27 @@ jobs:
138138 ](https://test.admin-interface.opencast.org/${{ steps.build-path.outputs.build }}).
139139
140140 It might take a few minutes for it to become available.
141+
142+ check-no-modified-translations :
143+ name : Translations only via Crowdin
144+ if : github.repository_owner == 'opencast'
145+ runs-on : ubuntu-latest
146+
147+ steps :
148+ - name : Checkout Sources
149+ uses : actions/checkout@v4
150+
151+ - name : Get changed locale files
152+ uses : dorny/paths-filter@v3
153+ id : filter_locales
154+ with :
155+ filters : | # !(pattern) matches anything but pattern
156+ locales:
157+ - 'src/i18n/org/opencastproject/adminui/languages/!lang-(en_US)*.json'
158+
159+ - name : Check for changes in translations
160+ if : steps.filter_locales.outputs.locales == true
161+ uses : actions/github-script@v7
162+ with :
163+ script : |
164+ core.setFailed('You should not alter translations outside of Crowdin.')
0 commit comments