Files
whisper-frontend/.gitea/workflows/deploy-branch.yaml
Andreas Svanberg 4a4b481dc4
Some checks failed
Clean up branch.dsv.su.se / Cleanup-branch (pull_request) Successful in 6s
Deploy to branch.dsv.su.se / Deploy-branch (pull_request) Failing after 1m5s
Attempt to fix comment URL
2024-07-08 13:55:00 +02:00

32 lines
1.1 KiB
YAML

name: Deploy to branch.dsv.su.se
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
jobs:
Deploy-branch:
runs-on: ubuntu-latest
steps:
- run: |
echo "${{ secrets.BRANCH_DEPLOY_KEY }}" >> ssh_key
chmod 0600 ssh_key
- run: echo "${{ gitea.serverurl }}/${{ gitea.repository }}.git ${{ gitea.headref }}" | ssh -o StrictHostKeyChecking=accept-new -i ssh_key branch.dsv.su.se
- name: View context attributes
uses: actions/github-script@v7
with:
script: |
console.log(context);
console.log(context.payload.pull_request.head);
const repositoryName = context.repo.repo;
const branchName = ${{ gitea.headref }};
console.log('repositoryName', repositoryName);
console.log('branchName', branchName);
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `https://${repositoryName}-${branchName}.branch.dsv.su.se`
})