From 11b14c12eba7286a60356720529c7a45a19e82c1 Mon Sep 17 00:00:00 2001 From: Zach Wolfenbarger Date: Tue, 19 Sep 2023 20:56:47 -0500 Subject: [PATCH] Manual sync template & workflow --- .github/workflows/manual_sync.yml | 31 +++++++++++++++++++++++++++++++ kubernetes/manual_sync.yml | 18 ++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/manual_sync.yml create mode 100644 kubernetes/manual_sync.yml diff --git a/.github/workflows/manual_sync.yml b/.github/workflows/manual_sync.yml new file mode 100644 index 0000000..f7e0c90 --- /dev/null +++ b/.github/workflows/manual_sync.yml @@ -0,0 +1,31 @@ +name: Manually Sync Listmonk + +on: + workflow_dispatch: + +jobs: + manual_sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_AKS }} + + - name: Set the target AKS cluster + uses: Azure/aks-set-context@v3 + with: + cluster-name: microservices + resource-group: kubernetes + + - name: Modify & apply template + run: kubectl create -f kubernetes/manual_sync.yml diff --git a/kubernetes/manual_sync.yml b/kubernetes/manual_sync.yml new file mode 100644 index 0000000..7196fbb --- /dev/null +++ b/kubernetes/manual_sync.yml @@ -0,0 +1,18 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generateName: listmonk-sync-job- +spec: + template: + metadata: + name: listmonk-sync + spec: + containers: + - name: listmonk-sync + image: ghcr.io/zooniverse/listmonk-sync + envFrom: + - secretRef: + name: listmonk-sync-env-vars + command: ['ruby', 'sync.rb'] + restartPolicy: Never + backoffLimit: 2