Skip to content

πŸš€ fix: cicd λ‚˜λˆ„κΈ° #1

πŸš€ fix: cicd λ‚˜λˆ„κΈ°

πŸš€ fix: cicd λ‚˜λˆ„κΈ° #1

Workflow file for this run

name: CD
on:
push:
branches: [ "main" ]
jobs:
deploy:

Check failure on line 8 in .github/workflows/cd.yml

View workflow run for this annotation

GitHub Actions / CD

Invalid workflow file

The workflow is not valid. .github/workflows/cd.yml (Line: 8, Col: 3): The workflow must contain at least one job with no dependencies.
needs: build
name: Deploy project
runs-on: ubuntu-latest
env:
working-directory: purithm
steps:
- name: Push to DockerHub
run: |
cd ${{ env.working-directory }}
docker login -u ${{secrets.DOCKERHUB_USERNAME}} -p ${{secrets.DOCKERHUB_TOKEN}}
docker build -t ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKER_REPO}} .
docker push ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKER_REPO}}
- name: Pull Docker
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
if sudo docker ps | grep ":8080->8080"; then
sudo docker stop $(sudo docker ps -qf "expose=8080")
fi
sudo docker login -u ${{secrets.DOCKERHUB_USERNAME}} -p ${{secrets.DOCKERHUB_TOKEN}}
sudo docker pull ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKER_REPO}}
sudo docker run -d -p 8080:8080 ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKER_REPO}}
sudo docker image prune -f