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.

  • Note: you should set up an ssh deploy key, and for the “first run,” you’ll need to clone your repo onto the system into your working-directory manually

  • Create two separate workflows in your repository, like this:

    • .github/workflows/autodeploy-develop.yml

      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