Deploy to prod skills #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to prod skills | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: commands on server | |
uses: garygrossgarten/github-action-ssh@release | |
with: | |
host: ${{ secrets.PROD_SERVER_HOST }} | |
username: ${{ secrets.PROD_SERVER_USER }} | |
password: ${{ secrets.PROD_SERVER_PASSWORD }} | |
command: | | |
cd ~/skills_api-prod-new && | |
git pull origin main && | |
rm -f .env && | |
touch .env && | |
echo "DEBUG=${{ secrets.DJANGO_DEBUG }}" >> .env && | |
echo "DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }}" >> .env && | |
echo "DATABASE_NAME=${{ secrets.PROD_DATABASE_NAME }}" >> .env && | |
echo "DATABASE_PASSWORD=${{ secrets.PROD_DATABASE_PASSWORD }}" >> .env && | |
echo "DATABASE_USER=${{ secrets.PROD_DATABASE_USER }}" >> .env && | |
echo "DATABASE_HOST=${{ secrets.DEV_DATABASE_HOST }}" >> .env && | |
echo "DATABASE_PORT=${{ secrets.DEV_DATABASE_PORT }}" >> .env && | |
echo "SELECTEL_ACCOUNT_ID=${{ secrets.DEV_SELECTEL_ACCOUNT_ID }}" >> .env && | |
echo "SELECTEL_CONTAINER_NAME=${{ secrets.SELECTEL_CONTAINER_NAME }}" >> .env && | |
echo "SELECTEL_SERVICE_USERNAME=${{ secrets.DEV_SELECTEL_SERVICE_USERNAME }}" >> .env && | |
echo "SELECTEL_SERVICE_PASSWORD=${{ secrets.SELECTEL_SERVICE_PASSWORD }}" >> .env && | |
echo "SELECTEL_PROJECT_ID=${{ secrets.SELECTEL_PROJECT_ID }}" >> .env && | |
echo "SELECTEL_PROJECT_NAME=${{ secrets.SELECTEL_PROJECT_NAME }}" >> .env && | |
echo "SELECTEL_READ_FILES_DOMAIN=${{ secrets.SELECTEL_READ_FILES_DOMAIN }}" >> .env && | |
echo "YOOKASSA_API_KEY=${{ secrets.DEV_YOOKASSA_API_KEY }}" >> .env && | |
echo "YOOKASSA_SHOP_ID=${{ secrets.DEV_YOOKASSA_SHOP_ID }}" >> .env && | |
docker compose -f docker-compose.prod-ci.yml stop && | |
docker compose -f docker-compose.prod-ci.yml up --build -d | |
# echo "DEBUG=${{ secrets.DJANGO_DEBUG }}" >> .env && | |
# echo "DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }}" >> .env && |