Fix initial appearance of thumbnail view #2320
Workflow file for this run
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: Test & Deploy | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
main: | |
if: ${{ needs.member.outputs.is_team_member == 'true' | |
|| github.event.pull_request.head.repo.full_name == 'opencast/opencast-editor' }} | |
needs: member | |
runs-on: ubuntu-latest | |
steps: | |
- name: generate build path | |
run: echo "::set-output name=build::${{github.event.number}}/$(date +%Y-%m-%d_%H-%M-%S)/" | sed 's_build::/*_build::_' | |
id: build-path | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Clean install | |
run: npm ci | |
- name: Build App | |
run: npm run build | |
env: | |
PUBLIC_URL: /${{ steps.build-path.outputs.build }} | |
- name: Prepare Git | |
run: | | |
git config --global user.name "Editor Deployment Bot" | |
git config --global user.email "opencast-support@elan-ev.de" | |
- name: Prepare GitHub SSH key | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_TEST }} | |
run: | | |
install -dm 700 ~/.ssh/ | |
echo "${DEPLOY_KEY}" > ~/.ssh/id_ed25519 | |
chmod 600 ~/.ssh/id_ed25519 | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
- name: Wait for previous workflows to finish | |
uses: softprops/turnstyle@v1 | |
with: | |
same-branch-only: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone repository | |
run: | | |
git clone "git@github.com:opencast/opencast-editor-test.git" ~/editor-test | |
cd ~/editor-test | |
git checkout gh-pages | |
- name: Store build | |
env: | |
DEPLOY_PATH: editor-test/${{ steps.build-path.outputs.build }} | |
run: | | |
mkdir -p "${HOME}/${DEPLOY_PATH}" | |
cp -rv build/* "${HOME}/${DEPLOY_PATH}" | |
- name: Generate index.html | |
run: | | |
cd ~/editor-test | |
echo '<html><body><ul>' > index.html | |
find . -maxdepth 2 -name '*_*' -type d \ | |
| sort -r \ | |
| sed 's/^\(.*\)$/<li><a href=\1>\1<\/a><\/li>/' >> index.html | |
echo '</ul></body></html>' >> index.html | |
- name: Commit new version | |
run: | | |
cd ~/editor-test | |
git add . | |
git commit -m "Build ${{ steps.build-path.outputs.build }}" | |
- name: Push updates | |
run: | | |
cd ~/editor-test | |
git push origin gh-pages | |
- name: Add comment with deployment location | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: > | |
This pull request is deployed at | |
[test.editor.opencast.org/${{ steps.build-path.outputs.build }} | |
](https://test.editor.opencast.org/${{ steps.build-path.outputs.build }}). | |
It might take a few minutes for it to become available. | |
member: | |
name: Check organization membership | |
runs-on: ubuntu-latest | |
# Map a step output to a job output | |
outputs: | |
is_team_member: ${{ steps.is_developer.outputs.permitted == 'true' || steps.is_committer.outputs.permitted == 'true' }} | |
steps: | |
- name: Check if user is Opencast developer | |
id: is_developer | |
if: ${{ github.event.pull_request.head.repo.full_name != 'opencast/opencast-editor' }} | |
uses: TheModdingInquisition/actions-team-membership@v1.0 | |
with: | |
team: developers | |
# Personal Access Token with the `read:org` permission | |
token: ${{ secrets.ORGANIZATION_MEMBER_SECRET }} | |
exit: false | |
- name: Check if user is Opencast committer | |
id: is_committer | |
if: ${{ github.event.pull_request.head.repo.full_name != 'opencast/opencast-editor' }} | |
uses: TheModdingInquisition/actions-team-membership@v1.0 | |
with: | |
team: committers | |
# Personal Access Token with the `read:org` permission | |
token: ${{ secrets.ORGANIZATION_MEMBER_SECRET }} | |
exit: false | |
translations: | |
name: Translations only via Crowdin | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
- name: Get changed locale files | |
uses: dorny/paths-filter@v3 | |
id: filter_locales | |
with: | |
filters: | # !(pattern) matches anything but pattern | |
locales: | |
- 'src/i18n/locales/!(en-US)*.json' | |
- name: Check for changes in translations | |
if: steps.filter_locales.outputs.locales == true | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.setFailed('You should not alter translations outside of Crowdin.') |