Skip to content

Commit 6d06f63

Browse files
author
Alcides Ramos
committed
docs(cd.yml): added file
1 parent 85c466a commit 6d06f63

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/cd.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Continuous Deployment
2+
3+
#on:
4+
# workflow_dispatch:
5+
# workflow_run:
6+
# workflows:
7+
# - "Continuous Integration"
8+
# types:
9+
# - completed
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build-and-deploy:
16+
name: Build & Deploy
17+
18+
runs-on: ubuntu-latest
19+
20+
env:
21+
ENV: PRODUCTION
22+
23+
steps:
24+
- name: Deploying via SSH
25+
uses: appleboy/ssh-action@v1.2.2
26+
with:
27+
host: ${{ secrets.HOST }}
28+
username: ${{ secrets.USERNAME }}
29+
password: ${{ secrets.PASSWORD }}
30+
port: ${{ secrets.PORT }}
31+
script: |
32+
sudo apt update && sudo apt upgrade -y
33+
docker buildx prune --force
34+
mkdir --parents /var/www/html/dockerized-php
35+
cd /var/www/html
36+
git -C dockerized-php pull || git clone git@github.com:AlcidesRC/dockerized-php.git .
37+
cd dockerized-php
38+
git fetch -ap && git reset --hard && git clean -fd && git pull
39+
unlink .env.makefile && echo "APP_ENV=prod" > .env.makefile
40+
make deploy

0 commit comments

Comments
 (0)