Compare commits
1
Commits
main
..
a2d2cab73b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2d2cab73b |
@@ -0,0 +1,47 @@
|
||||
name: build-and-deploy
|
||||
|
||||
on:
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
(github.event_name == 'pull_request_review' &&
|
||||
github.event.review.state == 'approved' &&
|
||||
github.event.review.author_association == 'OWNER')
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build, push, deploy
|
||||
uses: admin/brencher/.github/actions/brencher@main
|
||||
with:
|
||||
registry: gitea.rudolf.keenetic.link
|
||||
image_name: admin/reverseproxy
|
||||
stack_name: torrserv_proxy
|
||||
compose_path: docker-compose.yml
|
||||
swarm_manager_host: ${{ secrets.SWARM_MANAGER_HOST }}
|
||||
swarm_ssh_user: ${{ secrets.SWARM_SSH_USER }}
|
||||
swarm_ssh_key: ${{ secrets.SWARM_SSH_KEY }}
|
||||
registry_username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
registry_password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
deploy_branch: deploy/torrserv_proxy
|
||||
|
||||
- name: Comment on PR
|
||||
if: github.event_name == 'pull_request_review' && github.event.review.state == 'approved'
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
header: brencher-deploy
|
||||
message: |
|
||||
✅ Deployed `torrserv_proxy` at `${{ github.event.pull_request.head.sha || github.sha }}`
|
||||
- triggered by: @${{ github.event.review.user.login }}
|
||||
Reference in New Issue
Block a user