diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-12-22 16:12:36 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-12-22 16:12:46 -0500 |
| commit | 65274fa5ff3256d99c28185c7ee50f02211c9fc4 (patch) | |
| tree | 6a6eca4f0d63e6037359f9ab38100b21c323414d /.github | |
| parent | fea591df9b17c35742d67741f85bf32e687229e2 (diff) | |
| download | xesite-65274fa5ff3256d99c28185c7ee50f02211c9fc4.tar.xz xesite-65274fa5ff3256d99c28185c7ee50f02211c9fc4.zip | |
github workflows: make deployment logic better
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/earthly.yml | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/.github/workflows/earthly.yml b/.github/workflows/earthly.yml index 272292e..b76055e 100644 --- a/.github/workflows/earthly.yml +++ b/.github/workflows/earthly.yml @@ -45,21 +45,12 @@ jobs: name: "Deploy xesite" needs: build runs-on: alrest-xe-site + if: github.ref == 'refs/heads/main' permissions: contents: read - if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 - - uses: azure/setup-kubectl@v4 - - name: Save Civo kubeconfig - run: | - curl -sL https://civo.com/get | sudo sh - civo apikey add default $CIVO_TOKEN - civo apikey current default - civo kubernetes config --region phx1 aeacus --save --switch - env: - CIVO_TOKEN: ${{ secrets.CIVO_TOKEN }} - uses: dorny/paths-filter@v3 id: changes with: @@ -73,6 +64,17 @@ jobs: - 'go.sum' - 'Earthfile' - 'manifest/**/*.yaml' + - uses: azure/setup-kubectl@v4 + if: steps.changes.outputs.src == 'true' + - name: Save Civo kubeconfig + if: steps.changes.outputs.src == 'true' + run: | + curl -sL https://civo.com/get | sudo sh + civo apikey add default $CIVO_TOKEN + civo apikey current default + civo kubernetes config --region phx1 aeacus --save --switch + env: + CIVO_TOKEN: ${{ secrets.CIVO_TOKEN }} - name: "Deploy" if: steps.changes.outputs.src == 'true' run: | |
