File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -100,18 +100,28 @@ jobs:
100100 NEXT_PUBLIC_API_BASE_URL=${{secrets.NEXT_PUBLIC_API_BASE_URL}}
101101 NEXT_PUBLIC_WS_URL=${{secrets.NEXT_PUBLIC_WS_URL}}
102102 EOF
103+
104+ - name : Create .env for docker compose
105+ 106+ with :
107+ host : ${{ secrets.SSH_HOST }}
108+ username : ${{ secrets.SSH_USER }}
109+ key : ${{ secrets.SSH_KEY }}
110+ script : |
111+ mkdir -p /home/ubuntu/classlog
112+ cat > /home/ubuntu/classlog/.env <<EOF
113+ DOCKERHUB_USERNAME=${{ secrets.DOCKER_USERNAME }}
114+ IMAGE_TAG=${{ github.sha }}
115+ EOF
116+
103117 - name : Deploy containers
104118105119 with :
106120 host : ${{ secrets.SSH_HOST }}
107121 username : ${{ secrets.SSH_USER }}
108122 key : ${{ secrets.SSH_KEY }}
109123 script : |
110- cd /home/ubuntu/classlog
111- export DOCKERHUB_USERNAME="${{ secrets.DOCKER_USERNAME }}"
112- export IMAGE_TAG="${{ github.sha }}"
113-
114- echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
124+ echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
115125 docker compose down
116126 docker compose pull
117127 docker compose up -d
You can’t perform that action at this time.
0 commit comments