File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 1313
1414 steps :
1515 - name : Checkout 🛎️
16- uses : actions/checkout@v3
16+ uses : actions/checkout@v4
1717
1818 - name : Install SSH Client
1919 run : sudo apt-get update && sudo apt-get install -y openssh-client
@@ -34,11 +34,21 @@ jobs:
3434 - name : Deploy to Server 🚀
3535 run : |
3636 ssh server << 'EOF'
37+ set -euo pipefail
38+
3739 cd /var/www/cms/
38- export NODE_OPTIONS="--max_old_space_size=2048"
39- git pull origin main
40- yarn install
41- yarn build
42- pm2 restart 1337-cms.undershows.com.br
43- chown -R www-data:www-data /var/www/cms/
40+ git fetch --all
41+ git reset --hard origin/main
42+
43+ docker build -t undershows-cms .
44+
45+ docker stop undershows-cms || true
46+ docker rm undershows-cms || true
47+
48+ docker run -d --name undershows-cms --restart unless-stopped --env-file .env -p 127.0.0.1:1337:1337 -v $(pwd)/public/uploads:/app/public/uploads --read-only --tmpfs /tmp --tmpfs /app/.cache --tmpfs /app/.tmp --cap-drop ALL --security-opt no-new-privileges:true undershows-cms
49+
50+ sleep 2
51+ docker ps --filter "name=undershows-cms" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
52+ docker logs --tail=80 undershows-cms
53+
4454 EOF
You can’t perform that action at this time.
0 commit comments