testing
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 48s
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m22s

This commit is contained in:
Lee 2024-10-19 09:36:06 +01:00
parent 31f57cbe6b
commit 1f4be74c54
2 changed files with 83 additions and 45 deletions

@ -1,4 +1,4 @@
name: "Deploy Website" name: Deploy Website
on: on:
workflow_dispatch: workflow_dispatch:
@ -8,56 +8,90 @@ on:
paths: paths:
- projects/website/** - projects/website/**
- projects/common/** - projects/common/**
- .gitea/kubernetes/website/**
- .gitea/workflows/deploy-website.yml - .gitea/workflows/deploy-website.yml
jobs: jobs:
deploy: docker:
runs-on: ubuntu-latest strategy:
matrix:
arch: ["ubuntu-latest"]
runs-on: ${{ matrix.arch }}
# Steps to run
steps: steps:
- name: Checkout code # Checkout the repo
- name: Checkout
uses: actions/checkout@v4 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: with:
username: ${{ secrets.REGISTRY_USERNAME }} fetch-depth: 0
password: ${{ secrets.REGISTRY_TOKEN }}
registry: git.fascinated.cc
- name: Build Image # Deploy to Dokku
uses: docker/build-push-action@v6 - name: Push to dokku
uses: dokku/github-action@master
with: with:
context: . git_remote_url: "ssh://dokku@51.158.63.74:22/ssr-website"
file: ./projects/website/Dockerfile ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
push: true
tags: |
git.fascinated.cc/fascinated/scoresaber-reloaded-website:${{ github.sha }}
git.fascinated.cc/fascinated/scoresaber-reloaded-website:latest
build-args: |
GIT_REV=${{ gitea.sha }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Install kubectl #name: "Deploy Website"
uses: azure/setup-kubectl@v4 #
id: install #on:
# workflow_dispatch:
- name: Setup Kubernetes Context # push:
uses: azure/k8s-set-context@v4 # branches:
with: # - master
kubeconfig: ${{ secrets.KUBECONFIG }} # paths:
# - projects/website/**
- name: Deploy to Kubernetes # - projects/common/**
uses: Azure/k8s-deploy@v5 # - .gitea/kubernetes/website/**
with: # - .gitea/workflows/deploy-website.yml
action: deploy #
namespace: public-services #jobs:
manifests: | # deploy:
.gitea/kubernetes/website/deployment.yaml # runs-on: ubuntu-latest
.gitea/kubernetes/website/service.yaml # steps:
.gitea/kubernetes/website/ingress.yaml # - name: Checkout code
images: | # uses: actions/checkout@v4
git.fascinated.cc/fascinated/scoresaber-reloaded-website:${{ github.sha }} #
# - 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/website/Dockerfile
# push: true
# tags: |
# git.fascinated.cc/fascinated/scoresaber-reloaded-website:${{ github.sha }}
# git.fascinated.cc/fascinated/scoresaber-reloaded-website:latest
# build-args: |
# GIT_REV=${{ gitea.sha }}
# SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
#
# - 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/website/deployment.yaml
# .gitea/kubernetes/website/service.yaml
# .gitea/kubernetes/website/ingress.yaml
# images: |
# git.fascinated.cc/fascinated/scoresaber-reloaded-website:${{ github.sha }}

@ -27,4 +27,8 @@ COPY --from=depends /app/projects/backend ./projects/backend
# Lint before starting # Lint before starting
RUN bun --filter 'backend' lint RUN bun --filter 'backend' lint
ARG PORT=8080
ENV PORT $PORT
EXPOSE $PORT
CMD ["bun", "run", "--filter", "backend", "start"] CMD ["bun", "run", "--filter", "backend", "start"]