Skip to content

Commit

Permalink
created action for gauzy api stage on digitalOcean droplet
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey1330 committed Mar 5, 2024
1 parent e0bb63f commit 55bc2aa
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/deploy-do-droplet-pre-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ jobs:
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-cloudflare/docker-compose.api.demo.cloudflare.pre.yml,.deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.letsencrypt.pre.yml,.deploy/ssh/with-cloudflare/nginx.demo.pre.cloudflare.conf,.deploy/ssh/with-letsencrypt/demo/user_conf.d,.deploy/ssh/with-letsencrypt/demo/nginx-certbot.env,.deploy/ssh/with-cloudflare/ingress.api.crt,.deploy/ssh/with-cloudflare/ingress.api.key'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_DEMO_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker &> /dev/null; then
echo "Docker not installed. Installing..."
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
else
echo "Docker is already installed."
fi
- name: Install Docker Compose
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_DEMO_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker-compose &> /dev/null; then
echo "Docker Compose not installed. Installing..."
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
else
echo "Docker Compose is already installed."
fi
- name: Deploy to DigitalOcean Droplet
uses: appleboy/ssh-action@master
with:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/deploy-do-droplet-pre-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ jobs:
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-cloudflare/docker-compose.api.prod.cloudflare.pre.yml,.deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.letsencrypt.pre.yml,.deploy/ssh/with-cloudflare/nginx.prod.pre.cloudflare.conf,.deploy/ssh/with-letsencrypt/prod/user_conf.d,.deploy/ssh/with-letsencrypt/prod/nginx-certbot.env,.deploy/ssh/with-cloudflare/ingress.api.crt,.deploy/ssh/with-cloudflare/ingress.api.key'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_PROD_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker &> /dev/null; then
echo "Docker not installed. Installing..."
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
else
echo "Docker is already installed."
fi
- name: Install Docker Compose
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_PROD_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker-compose &> /dev/null; then
echo "Docker Compose not installed. Installing..."
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
else
echo "Docker Compose is already installed."
fi
- name: Deploy to DigitalOcean Droplet
uses: appleboy/ssh-action@master
with:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/deploy-do-droplet-pre-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ jobs:
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-cloudflare/docker-compose.api.stage.cloudflare.pre.yml,.deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.letsencrypt.pre.yml,.deploy/ssh/with-cloudflare/nginx.stage.pre.cloudflare.conf,.deploy/ssh/with-letsencrypt/stage/user_conf.d,.deploy/ssh/with-letsencrypt/stage/nginx-certbot.env,.deploy/ssh/with-cloudflare/ingress.api.crt,.deploy/ssh/with-cloudflare/ingress.api.key'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_STAGE_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker &> /dev/null; then
echo "Docker not installed. Installing..."
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
else
echo "Docker is already installed."
fi
- name: Install Docker Compose
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_STAGE_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker-compose &> /dev/null; then
echo "Docker Compose not installed. Installing..."
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
else
echo "Docker Compose is already installed."
fi
- name: Deploy to DigitalOcean Droplet
uses: appleboy/ssh-action@master
with:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/deploy-do-droplet-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,36 @@ jobs:
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.yml'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_PROD_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker &> /dev/null; then
echo "Docker not installed. Installing..."
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
else
echo "Docker is already installed."
fi
- name: Install Docker Compose
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_PROD_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker-compose &> /dev/null; then
echo "Docker Compose not installed. Installing..."
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
else
echo "Docker Compose is already installed."
fi
- name: Deploy to DigitalOcean Droplet
uses: appleboy/ssh-action@master
with:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/deploy-do-droplet-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,36 @@ jobs:
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.yml'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_STAGE_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker &> /dev/null; then
echo "Docker not installed. Installing..."
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
else
echo "Docker is already installed."
fi
- name: Install Docker Compose
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_STAGE_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
if ! command -v docker-compose &> /dev/null; then
echo "Docker Compose not installed. Installing..."
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
else
echo "Docker Compose is already installed."
fi
- name: Deploy to DigitalOcean Droplet
uses: appleboy/ssh-action@master
with:
Expand Down

0 comments on commit 55bc2aa

Please sign in to comment.