feat: modernize UI across all major pages #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy | |
| on: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set lowercase owner | |
| run: echo "OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV | |
| - name: Login to GHCR | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Build and Push Image | |
| run: | | |
| IMAGE=ghcr.io/${OWNER_LC}/stmorg:${{ github.sha }} | |
| docker build --no-cache -t $IMAGE . | |
| docker push $IMAGE | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to VPS | |
| uses: appleboy/ssh-action@v1.0.0 | |
| with: | |
| host: ${{ secrets.VPS_HOST }} | |
| username: ${{ secrets.VPS_USER }} | |
| key: ${{ secrets.VPS_SSH_KEY }} | |
| script: | | |
| APP_NAME="stmorg" | |
| OWNER_LC=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | |
| IMAGE="ghcr.io/$OWNER_LC/$APP_NAME:${{ github.sha }}" | |
| PROJECT_DIR="/home/weberqbot/apps/$APP_NAME" | |
| REPO_URL="git@github.com:${{ github.repository }}.git" | |
| mkdir -p /home/weberqbot/apps | |
| echo "Login to GHCR..." | |
| echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u $OWNER_LC --password-stdin | |
| if [ -d "$PROJECT_DIR" ]; then | |
| cd "$PROJECT_DIR" | |
| git pull origin main | |
| else | |
| git clone "$REPO_URL" "$PROJECT_DIR" | |
| cd "$PROJECT_DIR" | |
| fi | |
| echo "Pull exact image..." | |
| docker pull $IMAGE | |
| echo "Stop old container..." | |
| docker rm -f $APP_NAME || true | |
| echo "Run new container..." | |
| docker run -d \ | |
| --name $APP_NAME \ | |
| --network web_network \ | |
| --restart unless-stopped \ | |
| -l "traefik.enable=true" \ | |
| -l "traefik.http.routers.$APP_NAME.rule=Host(\`stmorg.in\`) || Host(\`www.stmorg.in\`)" \ | |
| -l "traefik.http.routers.$APP_NAME.entrypoints=web,websecure" \ | |
| -l "traefik.http.routers.$APP_NAME.tls=true" \ | |
| -l "traefik.http.routers.$APP_NAME.tls.certresolver=letsencrypt" \ | |
| -l "traefik.http.services.$APP_NAME.loadbalancer.server.port=80" \ | |
| $IMAGE | |