Skip to content

Update github-actions.yml #70

Update github-actions.yml

Update github-actions.yml #70

name: Deploy Next.js with Docker
on:
push:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker build and Push
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/meetfolio-web:latest .
docker push ${{secrets.DOCKER_USERNAME}}/meetfolio-web:latest
- name: Set ENV
env:
NEXT_PUBLIC_SERVER: ${{ secrets.NEXT_PUBLIC_SERVER }}
NEXT_PUBLIC_NEXT_SERVER: ${{ secrets.NEXT_PUBLIC_NEXT_SERVER }}
run: |
echo "NEXT_PUBLIC_SERVER=$NEXT_PUBLIC_SERVER" > .env.local
echo "NEXT_PUBLIC_NEXT_SERVER=$NEXT_PUBLIC_NEXT_SERVER" >> .env.local
- name: Deploy in GCP
uses: appleboy/ssh-action@master
env:
ENVFILE: "/home/meetfolio4/.env.local"

Check failure on line 37 in .github/workflows/github-actions.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/github-actions.yml

Invalid workflow file

You have an error in your yaml syntax on line 37
with:
host: ${{ secrets.GCE_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/meetfolio-web:latest
sudo docker tag ${{ secrets.DOCKER_USERNAME }}/meetfolio-web:latest meetfolio-web:latest
sudo docker rm -f meetfolio-web
sudo docker run -d --name meetfolio-web -v $ENVFILE:/usr/src/app -e TZ=Asia/Seoul -e PORT=60005 -p 60005:60005 meetfolio-web:latest
docker image prune -af