From 31f57cbe6b7feaec325110a6fc01fb49e2eec778 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 19 Oct 2024 09:19:43 +0100 Subject: [PATCH] testing --- .gitea/workflows/deploy-backend.yml | 126 ++++++++++++++++++---------- 1 file changed, 80 insertions(+), 46 deletions(-) diff --git a/.gitea/workflows/deploy-backend.yml b/.gitea/workflows/deploy-backend.yml index 005cd67..7ea046c 100644 --- a/.gitea/workflows/deploy-backend.yml +++ b/.gitea/workflows/deploy-backend.yml @@ -1,4 +1,4 @@ -name: "Deploy Backend" +name: Deploy Backend on: workflow_dispatch: @@ -8,57 +8,91 @@ on: paths: - projects/backend/** - projects/common/** - - .gitea/kubernetes/backend/** - .gitea/workflows/deploy-backend.yml jobs: - deploy: - runs-on: ubuntu-latest + docker: + strategy: + matrix: + arch: ["ubuntu-latest"] + runs-on: ${{ matrix.arch }} + + # Steps to run steps: - - name: Checkout code + # Checkout the repo + - name: Checkout uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 with: - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_TOKEN }} - registry: git.fascinated.cc + fetch-depth: 0 - - name: Build Image - uses: docker/build-push-action@v6 + # Deploy to Dokku + - name: Push to dokku + uses: dokku/github-action@master with: - context: . - file: ./projects/backend/Dockerfile - push: true - tags: | - git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }} - git.fascinated.cc/fascinated/scoresaber-reloaded-backend:latest - build-args: | - GIT_REV=${{ gitea.sha }} + git_remote_url: "ssh://dokku@51.158.63.74:22/ssr-backend" + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Install kubectl - uses: azure/setup-kubectl@v4 - id: install - - - name: Setup Kubernetes Context - uses: azure/k8s-set-context@v4 - with: - kubeconfig: ${{ secrets.KUBECONFIG }} - - - name: Deploy to Kubernetes - uses: Azure/k8s-deploy@v5 - with: - action: deploy - namespace: public-services - manifests: | - .gitea/kubernetes/backend/sealed-secret.yaml - .gitea/kubernetes/backend/deployment.yaml - .gitea/kubernetes/backend/service.yaml - .gitea/kubernetes/backend/strip-api-prefix-middleware.yaml - .gitea/kubernetes/backend/ingress.yaml - images: | - git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }} +#name: "Deploy Backend" +# +#on: +# workflow_dispatch: +# push: +# branches: +# - master +# paths: +# - projects/backend/** +# - projects/common/** +# - .gitea/kubernetes/backend/** +# - .gitea/workflows/deploy-backend.yml +# +#jobs: +# deploy: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# +# - name: Login to Docker Hub +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.REGISTRY_USERNAME }} +# password: ${{ secrets.REGISTRY_TOKEN }} +# registry: git.fascinated.cc +# +# - name: Build Image +# uses: docker/build-push-action@v6 +# with: +# context: . +# file: ./projects/backend/Dockerfile +# push: true +# tags: | +# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }} +# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:latest +# build-args: | +# GIT_REV=${{ gitea.sha }} +# +# - name: Install kubectl +# uses: azure/setup-kubectl@v4 +# id: install +# +# - name: Setup Kubernetes Context +# uses: azure/k8s-set-context@v4 +# with: +# kubeconfig: ${{ secrets.KUBECONFIG }} +# +# - name: Deploy to Kubernetes +# uses: Azure/k8s-deploy@v5 +# with: +# action: deploy +# namespace: public-services +# manifests: | +# .gitea/kubernetes/backend/sealed-secret.yaml +# .gitea/kubernetes/backend/deployment.yaml +# .gitea/kubernetes/backend/service.yaml +# .gitea/kubernetes/backend/strip-api-prefix-middleware.yaml +# .gitea/kubernetes/backend/ingress.yaml +# images: | +# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}