...
Install a runner on dev, and another on prod, using
--labels=develop
and--labels=main
or whatever. It is customary to match your branch names.Create two separate workflows in your repository, e.g. .like this:
.github/workflows/autodeploy-develop
.yml
develop
Code Block name: autodeploy-develop on: push: branches: - develop jobs: autodeploy: runs-on: [ self-hosted, develop ] steps: - working-directory: /path/to/repository run: git pull
.github/workflows/autodeploy-main.yml
Code Block name: autodeploy-main on: push: branches: - main jobs: autodeploy: runs-on: [ self-hosted, main ] steps: - working-directory: /path/to/repository run: git pull