From 0eaae2a2014657547b92fa87aee336bd3eda9702 Mon Sep 17 00:00:00 2001 From: Beksultan Borbuev Date: Mon, 26 Aug 2024 18:41:14 +0600 Subject: [PATCH] Migrate docs to AWS --- .github/workflows/open-api-docs-ci-cd.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/open-api-docs-ci-cd.yml b/.github/workflows/open-api-docs-ci-cd.yml index 2be021a..6a1cd6d 100644 --- a/.github/workflows/open-api-docs-ci-cd.yml +++ b/.github/workflows/open-api-docs-ci-cd.yml @@ -8,6 +8,7 @@ on: jobs: deploy: + environment: production name: Deploy docs runs-on: ubuntu-latest @@ -29,19 +30,19 @@ jobs: - name: Setup SSH connection run: | eval $(ssh-agent -s) - echo "${{ secrets.DEPLOY_KEY }}" > deploy_key + echo "${{ secrets.PRODUCTION_KEY }}" > deploy_key chmod 600 ./deploy_key mkdir -p ~/.ssh chmod 700 ~/.ssh - ssh-keyscan ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secrets.PRODUCTION_HOST }} >> ~/.ssh/known_hosts chmod 644 ~/.ssh/known_hosts - name: Update files - run: rsync -avzhO --no-p --no-g --delete -e "ssh -i ./deploy_key" public/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/var/www/docs.openfuture.io/ + run: rsync -avzhO --no-p --no-g --delete -e "ssh -i ./deploy_key" public/ ${{ secrets.PRODUCTION_USER }}@${{ secrets.PRODUCTION_HOST }}:/var/www/html/docs.openfuture.io/ - name: Update SSL certificate run: | - ssh -i ./deploy_key ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} " + ssh -i ./deploy_key ${{ secrets.PRODUCTION_USER }}@${{ secrets.PRODUCTION_HOST }} " docker run --rm --name certbot \ -v /etc/letsencrypt:/etc/letsencrypt \ -v /var/www/certbot:/var/www/certbot \ @@ -49,7 +50,7 @@ jobs: certbot/certbot \ certonly --webroot -w /var/www/certbot/ \ -d docs.openfuture.io \ - --renew-by-default -m team@openfuture.io --eff-email --agree-tos --manual-public-ip-logging-ok + --renew-by-default -m beksultan@openfuture.io --eff-email --agree-tos --manual-public-ip-logging-ok " - ssh -i ./deploy_key ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} " + ssh -i ./deploy_key ${{ secrets.PRODUCTION_USER }}@${{ secrets.PRODUCTION_HOST }} " sudo service nginx reload"