Skip to content

debug

debug #19

Workflow file for this run

name: CD
on:
# push:
# branches:
# - main
# - dev
# paths:
# - 'microservices/**'
# - 'config/**'
# - 'cmd/**'
pull_request: {}
push: {}
jobs:
# build:
# name: Build
# runs-on: ubuntu-latest
# env:
# ENV: prod
# DOCKER_COMPOSE_PATH: docker/docker-compose.prod.yaml
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# steps:
# - name: Check out code into directory
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Log in to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ env.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push microservice images
# run: |
# services=(user playlist artist album track csat genre)
# for service in "${services[@]}"; do
# docker compose -f "$DOCKER_COMPOSE_PATH" build novamusic-${service}
# docker tag ${DOCKER_USERNAME}/novamusic-${service}:latest ${DOCKER_USERNAME}/novamusic-${service}:${GITHUB_SHA::8}
# docker push ${DOCKER_USERNAME}/novamusic-${service}:${GITHUB_SHA::8}
# docker push ${DOCKER_USERNAME}/novamusic-${service}:latest
# done
migrate:
name: Postgres Migration
runs-on: ubuntu-latest
# needs: build
steps:
- name: Check out code into directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clear target directory
uses: appleboy/[email protected]
with:
host: 185.241.194.24
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: |
rm -rf /home/ubuntu/nova-music/backend/internal/db/postgres/migrations/*
- name: Copy migration files to server
uses: appleboy/[email protected]
with:
host: 185.241.194.24
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
source: "internal/db/postgres/migrations/*"
target: "/home/ubuntu/nova-music/backend/"
- name: Run database migrations
uses: appleboy/[email protected]
with:
host: 185.241.194.24
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: |
cd /home/ubuntu/nova-music/backend/
sudo make postgres-migrate