studentportalen/.gitea/workflows/branch-deploy.yaml
Andreas Svanberg e2a263ee03 Update automatic deployment action (#13)
Backward breaking changes in the deployment scripts that necessitates an upgrade to `v3`.

Reviewed-on: #13
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-12-01 10:45:13 +01:00

28 lines
846 B
YAML

name: Deploy to branch.dsv.su.se
on:
- pull_request
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- id: deploy
uses: https://gitea.dsv.su.se/ansv7779/action-branch-deploy@v3
with:
ssh-key: ${{ secrets.BRANCH_DEPLOY_KEY }}
compose-file: branch-compose.yaml
mode: 'deploy'
- name: Post URL to deployment as comment
uses: actions/github-script@v7
if: github.event.action == 'opened'
env:
BRANCH_URL: ${{ steps.deploy.outputs.url }}
with:
script: |
const url = process.env.BRANCH_URL;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Deployed to ${url}`
})