Skip to content

NM-101: fix cd github action #10

NM-101: fix cd github action

NM-101: fix cd github action #10

Workflow file for this run

name: CD
on:
push:
branches:
- main
- dev
paths:
- 'microservices/**'
- 'config/**'
- 'cmd/**'
pull_request:
branches:
- dev
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:

Check failure on line 49 in .github/workflows/cd.yaml

View workflow run for this annotation

GitHub Actions / CD

Invalid workflow file

The workflow is not valid. .github/workflows/cd.yaml (Line: 49, Col: 3): The workflow must contain at least one job with no dependencies.
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: 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/internal/db/postgres/migrations/"
- 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