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 55bc2aa commit 74f49b0
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-do-droplet-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
- name: Inject secrets into .env-template.compose
run: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.demo.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.demo.yml
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.yml
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.demo.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.yml
else
echo "UNKNOWN INGRESS_CERT_TYPE"
fi
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
host: ${{secrets.DO_DROPLET_DEMO_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-cloudflare/docker-compose.api.demo.yml'
source: '.deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.yml'
target: '.'
- name: Copy file via scp - with-letsencrypt
if: ${{ env.INGRESS_CERT_TYPE == 'letsencrypt' }}
Expand Down Expand Up @@ -198,9 +198,9 @@ jobs:
script: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
docker-compose -f .deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.yml down
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.demo.yml up -d
docker-compose -f .deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.yml up -d
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.demo.yml down
docker-compose -f .deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.yml down
docker-compose -f .deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.yml up -d
else
echo "Unknown INGRESS_CERT_TYPE: $INGRESS_CERT_TYPE"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deploy-do-droplet-pre-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:

- name: Generate TLS Secrets for DO Droplet
run: |
rm -f $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.crt $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.key
echo ${{ secrets.INGRESS_API_CERT }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.crt
echo ${{ secrets.INGRESS_API_CERT_KEY }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.key
rm -f $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/demo/ingress.api.crt $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/demo/ingress.api.key
echo ${{ secrets.INGRESS_API_CERT }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/demo/ingress.api.crt
echo ${{ secrets.INGRESS_API_CERT_KEY }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/demo/ingress.api.key
- name: Copy file via scp
uses: appleboy/scp-action@master
with:
host: ${{secrets.DO_DROPLET_DEMO_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
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'
source: '.deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.cloudflare.pre.yml,.deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.letsencrypt.pre.yml,.deploy/ssh/with-cloudflare/demo/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/demo/ingress.api.crt,.deploy/ssh/with-cloudflare/demo/ingress.api.key'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
Expand Down Expand Up @@ -74,9 +74,9 @@ jobs:
script: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
docker-compose -f .deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.letsencrypt.pre.yml down
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.demo.cloudflare.pre.yml up -d
docker-compose -f .deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.cloudflare.pre.yml up -d
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.demo.cloudflare.pre.yml down
docker-compose -f .deploy/ssh/with-cloudflare/demo/docker-compose.api.demo.cloudflare.pre.yml down
docker-compose -f .deploy/ssh/with-letsencrypt/demo/docker-compose.api.demo.letsencrypt.pre.yml up -d
else
echo "Unknown INGRESS_CERT_TYPE: $INGRESS_CERT_TYPE"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deploy-do-droplet-pre-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:

- name: Generate TLS Secrets for DO Droplet
run: |
rm -f $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.crt $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.key
echo ${{ secrets.INGRESS_API_CERT }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.crt
echo ${{ secrets.INGRESS_API_CERT_KEY }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.key
rm -f $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/prod/ingress.api.crt $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/prod/ingress.api.key
echo ${{ secrets.INGRESS_API_CERT }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/prod/ingress.api.crt
echo ${{ secrets.INGRESS_API_CERT_KEY }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/prod/ingress.api.key
- name: Copy file via scp
uses: appleboy/scp-action@master
with:
host: ${{secrets.DO_DROPLET_PROD_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
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'
source: '.deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.cloudflare.pre.yml,.deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.letsencrypt.pre.yml,.deploy/ssh/with-cloudflare/prod/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/prod/ingress.api.crt,.deploy/ssh/with-cloudflare/prod/ingress.api.key'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
Expand Down Expand Up @@ -74,9 +74,9 @@ jobs:
script: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
docker-compose -f .deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.letsencrypt.pre.yml down
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.prod.cloudflare.pre.yml up -d
docker-compose -f .deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.cloudflare.pre.yml up -d
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.prod.cloudflare.pre.yml down
docker-compose -f .deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.cloudflare.pre.yml down
docker-compose -f .deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.letsencrypt.pre.yml up -d
else
echo "Unknown INGRESS_CERT_TYPE: $INGRESS_CERT_TYPE"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deploy-do-droplet-pre-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:

- name: Generate TLS Secrets for DO Droplet
run: |
rm -f $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.crt $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.key
echo ${{ secrets.INGRESS_API_CERT }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.crt
echo ${{ secrets.INGRESS_API_CERT_KEY }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/ingress.api.key
rm -f $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/stage/ingress.api.crt $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/stage/ingress.api.key
echo ${{ secrets.INGRESS_API_CERT }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/stage/ingress.api.crt
echo ${{ secrets.INGRESS_API_CERT_KEY }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/stage/ingress.api.key
- name: Copy file via scp
uses: appleboy/scp-action@master
with:
host: ${{secrets.DO_DROPLET_STAGE_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
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'
source: '.deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.cloudflare.pre.yml,.deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.letsencrypt.pre.yml,.deploy/ssh/with-cloudflare/stage/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/stage/ingress.api.crt,.deploy/ssh/with-cloudflare/stage/ingress.api.key'
target: '.'
- name: Install Docker
uses: appleboy/ssh-action@master
Expand Down Expand Up @@ -74,9 +74,9 @@ jobs:
script: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
docker-compose -f .deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.letsencrypt.pre.yml down
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.stage.cloudflare.pre.yml up -d
docker-compose -f .deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.cloudflare.pre.yml up -d
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.stage.cloudflare.pre.yml down
docker-compose -f .deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.cloudflare.pre.yml down
docker-compose -f .deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.letsencrypt.pre.yml up -d
else
echo "Unknown INGRESS_CERT_TYPE: $INGRESS_CERT_TYPE"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-do-droplet-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
- name: Inject secrets into .env-template.compose
run: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.prod.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.prod.yml
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.yml
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.prod.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.yml
else
echo "UNKNOWN INGRESS_CERT_TYPE"
fi
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
host: ${{secrets.DO_DROPLET_PROD_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-cloudflare/docker-compose.api.prod.yml'
source: '.deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.yml'
target: '.'
- name: Copy file via scp - with-letsencrypt
if: ${{ env.INGRESS_CERT_TYPE == 'letsencrypt' }}
Expand Down Expand Up @@ -198,9 +198,9 @@ jobs:
script: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
docker-compose -f .deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.yml down
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.prod.yml up -d
docker-compose -f .deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.yml up -d
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.prod.yml down
docker-compose -f .deploy/ssh/with-cloudflare/prod/docker-compose.api.prod.yml down
docker-compose -f .deploy/ssh/with-letsencrypt/prod/docker-compose.api.prod.yml up -d
else
echo "Unknown INGRESS_CERT_TYPE: $INGRESS_CERT_TYPE"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-do-droplet-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
- name: Inject secrets into .env-template.compose
run: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.stage.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.stage.yml
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.yml
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
envsubst < $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.template.yml > temp.yaml && mv temp.yaml $GITHUB_WORKSPACE/.deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/docker-compose.api.stage.yml
touch $GITHUB_WORKSPACE/.deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.yml
else
echo "UNKNOWN INGRESS_CERT_TYPE"
fi
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
host: ${{secrets.DO_DROPLET_STAGE_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/with-cloudflare/docker-compose.api.stage.yml'
source: '.deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.yml'
target: '.'
- name: Copy file via scp - with-letsencrypt
if: ${{ env.INGRESS_CERT_TYPE == 'letsencrypt' }}
Expand Down Expand Up @@ -198,9 +198,9 @@ jobs:
script: |
if [ "${{ env.INGRESS_CERT_TYPE }}" = "cloudflare" ]; then
docker-compose -f .deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.yml down
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.stage.yml up -d
docker-compose -f .deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.yml up -d
elif [ "${{ env.INGRESS_CERT_TYPE }}" = "letsencrypt" ]; then
docker-compose -f .deploy/ssh/with-cloudflare/docker-compose.api.stage.yml down
docker-compose -f .deploy/ssh/with-cloudflare/stage/docker-compose.api.stage.yml down
docker-compose -f .deploy/ssh/with-letsencrypt/stage/docker-compose.api.stage.yml up -d
else
echo "Unknown INGRESS_CERT_TYPE: $INGRESS_CERT_TYPE"
Expand Down

0 comments on commit 74f49b0

Please sign in to comment.