Skip to content

Commit

Permalink
Update github-actions.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kylo-dev authored Apr 24, 2024
1 parent e2c4407 commit a7b4f61
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,21 @@ jobs:

- name: Docker build and Push
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/meetfolio-web:latest .
docker build \
--build-arg NEXT_PUBLIC_SERVER=${{ secrets.NEXT_PUBLIC_SERVER }} \
--build-arg NEXT_PUBLIC_NEXT_SERVER=${{ secrets.NEXT_PUBLIC_NEXT_SERVER }} \
-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" > myfile
echo "NEXT_PUBLIC_NEXT_SERVER=$NEXT_PUBLIC_NEXT_SERVER" >> myfile
cat myfile
- name: Deploy in GCP
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.GCE_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
rm -rf .env.local
echo "NEXT_PUBLIC_SERVER=${{ secrets.NEXT_PUBLIC_SERVER }}" > .env.local
echo "NEXT_PUBLIC_NEXT_SERVER=${{ secrets.NEXT_PUBLIC_NEXT_SERVER }}" >> .env.local
cat .env.local
echo "ENVFILE: /home/meetfolio4/.env.local"
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 -e TZ=Asia/Seoul -e PORT=60005 -p 60005:60005 meetfolio-web:latest
sudo docker cp /home/meetfolio4/.env.local meetfolio-web:/usr/src/app/.env.local
sudo docker image prune -af

0 comments on commit a7b4f61

Please sign in to comment.