Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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 and .github/workflows/autodeploy-main
    • .yml

    . Configure them like this:
    • 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