Deploy theme to several instances via GitHub Actions

Hi everyone,

I wonder if it is possible to deploy a theme with Github Actions to several Ghost instances?

I’m not really familiar with Github Actions, but I’m guessing it would be possible to change the GA file to add multiple instances and/or deployments?

Any idea would help, thanks!

name: Deploy Theme
on:
  push:
    branches:
      - master
      - main
jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
      - name: Deploy Ghost Theme
        uses: TryGhost/action-deploy-theme@v1.4.0
        with:
          api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
          api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}

Hey @simardcasanova! :wave: Sure - you could do the following:

name: Deploy Theme
on:
  push:
    branches:
      - master
      - main
jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
      - name: Deploy to site X
        uses: TryGhost/action-deploy-theme@v1.4.1
        with:
          api-url: ${{ secrets.SITE_X_ADMIN_API_URL }}
          api-key: ${{ secrets.SITE_X_ADMIN_API_KEY }}
      - name: Deploy to site Y
        uses: TryGhost/action-deploy-theme@v1.4.1
        with:
          api-url: ${{ secrets.SITE_Y_ADMIN_API_URL }}
          api-key: ${{ secrets.SITE_Y_ADMIN_API_KEY }}

and be sure to add your secrets in GitHub :slightly_smiling_face:

1 Like

Awesome, thank you! I will save me an awful LOT of time.

1 Like

Exactly, you simply re-use the same action over and over :-p

1 Like