Skip to content

Test Deploy

Test Deploy #1234

Workflow file for this run

name: Test Deploy
on:
workflow_run:
workflows: ["Build & test"]
types: [completed]
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'elan-ev'
steps:
- name: Prepare deploy key
run: |
mkdir ~/.ssh
chmod 700 ~/.ssh
echo "${{ secrets.STUDIO_TEST_DEPLOY_KEY }}" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Download artifacts from build workflow
uses: actions/download-artifact@4
with:
name: test-deployment-files
run-id: ${{ github.event.workflow_run.id }}
- name: Checkout test deployment repo
run: |
rm -rf studio-test || :
git clone "[email protected]:elan-ev/studio-test.git"
cd studio-test
git checkout gh-pages
- name: Prepare deployment files
run: |
deploydir=$(cat deploydir.tmp)
mkdir studio-test/${deploydir}
mv .github/.deploy-settings.toml studio-test/${deploydir}/settings.toml
mv build/* studio-test/${deploydir}/
rmdir build
- name: Build new index HTML
working-directory: studio-test
run: |
echo '<html><body><ul>' > index.html
find . -maxdepth 1 -name '20*' -type d \
| sort -r \
| sed 's/^\(.*\)$/<li><a href=\1>\1<\/a><\/li>/' >> index.html
echo '</ul></body></html>' >> index.html
- name: Commit and push
working-directory: studio-test
run: |
git add .
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git commit -m "Deploy ${{ github.event.workflow_run.head_sha }} ($(date))"
git push origin gh-pages