aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-12-22 16:12:36 -0500
committerXe Iaso <me@xeiaso.net>2024-12-22 16:12:46 -0500
commit65274fa5ff3256d99c28185c7ee50f02211c9fc4 (patch)
tree6a6eca4f0d63e6037359f9ab38100b21c323414d /.github
parentfea591df9b17c35742d67741f85bf32e687229e2 (diff)
downloadxesite-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.yml22
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: |