File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 2828 username : ${{ github.repository_owner }}
2929 password : ${{ secrets.GITHUB_TOKEN }}
3030
31+ - name : Build the Docker image
32+ run : docker build ./${{env.IMAGE_NAME}} --file ./${{env.IMAGE_NAME}}/Dockerfile --tag ${{env.IMAGE_NAME}}:${{ env.TIMESTAMP }}
33+
34+ - name : Save Docker image to file
35+ run : docker save ${{ env.IMAGE_TAG }} | gzip > iot-backend.tar.gz
36+
3137 - name : Connect Tailscale
3238 uses : tailscale/github-action@v2
3339 with :
3743
3844 - name : Do the deploy thing
3945 run : |
40- ssh -o "StrictHostKeyChecking no" $HOST@nilss-mac-mini ""
46+ ssh -o "StrictHostKeyChecking no" $HOST@nilss-mac-mini "
47+ cd ~/Projects/iot-home/deployment/backend
48+ gunzip -f iot-backend.tar.gz
49+ docker load < iot-backend.tar
50+ docker stop iot-backend || true
51+ docker rm iot-backend || true
52+ docker run -d --name iot-backend -p 3000:3000 ${{ env.IMAGE_NAME }}:${{ env.TIMESTAMP }}
53+ "
You can’t perform that action at this time.
0 commit comments