From 16ec411eaa646ea8ec8c27ecd43ecea2f88af4e9 Mon Sep 17 00:00:00 2001 From: Dunemask Date: Tue, 20 Feb 2024 02:23:17 -0700 Subject: [PATCH] [FEATURE] Workflow Overhaul --- .gitea/workflows/deploy-edge-proxy.yml | 38 ++++++++++++++++++-------- .gitea/workflows/deploy-edge.yml | 35 ++++++++++++++---------- .gitea/workflows/qa-api-tests.yml | 24 ++++++++++------ 3 files changed, 63 insertions(+), 34 deletions(-) diff --git a/.gitea/workflows/deploy-edge-proxy.yml b/.gitea/workflows/deploy-edge-proxy.yml index 3551003..e4dc61d 100644 --- a/.gitea/workflows/deploy-edge-proxy.yml +++ b/.gitea/workflows/deploy-edge-proxy.yml @@ -5,19 +5,35 @@ on: branches: [ master ] env: - GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }} - KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_EDGE }} GARDEN_DEPLOY_ACTION: minecluster-proxy - jobs: deploy-edge: steps: - - name: Oasis Setup - uses: https://gitea.dunemask.dev/elysium/oasis-action@master - with: - gitea-token: ${{ env.GITEA_TOKEN }} - kubeconfig: ${{ env.KUBECONFIG_BASE64 }} - - name: Deploy to Edge env - run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge - working-directory: ${{ env.OASIS_WORKSPACE }} \ No newline at end of file + # Configure proper kubeconfig + - name: Get usw-mc deployment kubeconfig + uses: https://gitea.dunemask.dev/elysium/elysium-actions@infisical-env + with: + infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} + secret-envs: edge + secret-paths: /kubernetes + # Setup Oasis + - name: Oasis Setup + uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto + with: + deploy-env: edge + infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} + kubeconfig: ${{ env.KUBERNETES_CONFIG_USW_MC }} + # Deploy to Edge Cluster + - name: Deploy to Edge Cluster + run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge + working-directory: ${{ env.OASIS_WORKSPACE }} + # Alert via Discord + - name: Discord Alert + if: always() + uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status + with: + status: ${{ job.status }} + channel: deployments + header: DEPLOY EDGE + additional-content: "Minecluster Proxy" \ No newline at end of file diff --git a/.gitea/workflows/deploy-edge.yml b/.gitea/workflows/deploy-edge.yml index fc9ed65..530be68 100644 --- a/.gitea/workflows/deploy-edge.yml +++ b/.gitea/workflows/deploy-edge.yml @@ -5,22 +5,29 @@ on: branches: [ master ] env: - GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }} - KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_MC }} GARDEN_DEPLOY_ACTION: minecluster - # Additional Deploy Envars - POSTGRES_PROD_PASSWORD: ${{ secrets.POSTGRES_PROD_PASSWORD }} - MCL_KUBECONFIG: ${{ secrets.KUBECONFIG_USW_MC }} - jobs: deploy-edge: steps: - - name: Oasis Setup - uses: https://gitea.dunemask.dev/elysium/oasis-action@master - with: - gitea-token: ${{ env.GITEA_TOKEN }} - kubeconfig: ${{ env.KUBECONFIG_BASE64 }} - - name: Deploy to Edge env - run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-mc - working-directory: ${{ env.OASIS_WORKSPACE }} \ No newline at end of file + # Setup Oasis + - name: Oasis Setup + uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto + with: + deploy-env: edge + infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} + extra-secret-paths: /alexandria + extra-secret-envs: edge + # Deploy to Edge + - name: Deploy to Edge env + run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge + working-directory: ${{ env.OASIS_WORKSPACE }} + # Alert via Discord + - name: Discord Alert + if: always() + uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status + with: + status: ${{ job.status }} + channel: deployments + header: DEPLOY MC + additional-content: "Minecluster Server Manager Deployment" \ No newline at end of file diff --git a/.gitea/workflows/qa-api-tests.yml b/.gitea/workflows/qa-api-tests.yml index 4014415..8222cdf 100644 --- a/.gitea/workflows/qa-api-tests.yml +++ b/.gitea/workflows/qa-api-tests.yml @@ -6,31 +6,37 @@ on: env: REPO_DIR: ${{ gitea.workspace }}/minecluster - KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_DEV }} - GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }} GARDEN_LINK_ACTION: build.minecluster-image jobs: qa-api-tests: steps: + # Setup Oasis - name: Oasis Setup - uses: https://gitea.dunemask.dev/elysium/oasis-action@master + uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto with: - gitea-token: ${{ env.GITEA_TOKEN }} - kubeconfig: ${{ env.KUBECONFIG_BASE64 }} + deploy-env: ci + infisical-token: ${{ secrets.INFISICAL_ELYSIUM_CI_READ_TOKEN }} # Test Code - name: Checkout repository uses: actions/checkout@v3 with: path: ${{ env.REPO_DIR }} - # Garden tests + # Garden link - name: Link Repo code to Garden run: garden link action $GARDEN_LINK_ACTION $REPO_DIR --env usw-ci --var cubit-projects=cairo,minecluster working-directory: ${{ env.OASIS_WORKSPACE }} # Cubit CI Tests - name: Run Cubit tests in CI env - run: garden workflow qa-api-tests --env usw-ci --var ci-ttl=25 + run: garden workflow qa-api-tests --env usw-ci --var ci-ttl=25m working-directory: ${{ env.OASIS_WORKSPACE }} - - name: Status Alert + # Discord Alert + - name: Discord Alert if: always() - run: echo "The Job ended with status ${{ job.status }}." \ No newline at end of file + uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status + with: + status: ${{ job.status }} + channel: ci + header: QA API Tests + additional-content: "CI Namespace: `${{env.CI_NAMESPACE}}`" + \ No newline at end of file