From 65274fa5ff3256d99c28185c7ee50f02211c9fc4 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 22 Dec 2024 16:12:36 -0500 Subject: github workflows: make deployment logic better Signed-off-by: Xe Iaso --- .github/workflows/earthly.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to '.github/workflows') 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: | -- cgit v1.2.3