Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed May 17, 2024
1 parent d843dbc commit 9e1e1e9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 23 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ jobs:
cp ./Dockerfile ./${{ env.CI_JOB_ID }}/Dockerfile
cp ./pyproject.toml ./${{ env.CI_JOB_ID }}/pyproject.toml
- name: Create .env file with current secrets
run: |
cd ./${{ env.CI_JOB_ID }}
touch .env
echo API_ENDPOINT="https://xxx.execute-api.us-west-2.amazonaws.com" >> .env
echo API_KEY=${{ secrets.API_KEY }} >> .env
echo MATRIX_HOME_SERVER=${{ secrets.MATRIX_HOME_SERVER }} >> .env
echo MATRIX_BOT_USERNAME=${{ secrets.MATRIX_BOT_USERNAME }} >> .env
echo MATRIX_BOT_PASSWORD=${{ secrets.MATRIX_BOT_PASSWORD }} >> .env
echo ERRORS_ROOM_ID=${{ secrets.ERRORS_ROOM_ID }} >> .env
echo USER_ALLOWED_DOMAINS=${{ secrets.USER_ALLOWED_DOMAINS }} >> .env
echo SALT=${{ secrets.SALT }} >> .env
echo ALBERT_API_URL=${{ secrets.ALBERT_API_URL }} >> .env
echo ALBERT_API_TOKEN=${{ secrets.ALBERT_API_TOKEN }} >> .env
echo ALBERT_API_MODEL_NAME=${{ secrets.ALBERT_API_MODEL_NAME }} >> .env
echo ALBERT_API_MODE=${{ secrets.ALBERT_API_MODE }} >> .env
cat .env
- name: Copy deployment files to remote server via SCP
uses: appleboy/scp-action@master
with:
Expand All @@ -58,17 +76,6 @@ jobs:

- name: Execute server commands for deploy
uses: appleboy/ssh-action@master
env:
MATRIX_HOME_SERVER: ${{ secrets.MATRIX_HOME_SERVER }}
MATRIX_BOT_USERNAME: ${{ secrets.MATRIX_BOT_USERNAME }}
MATRIX_BOT_PASSWORD: ${{ secrets.MATRIX_BOT_PASSWORD }}
ERRORS_ROOM_ID: ${{ secrets.ERRORS_ROOM_ID }}
USER_ALLOWED_DOMAINS: ${{ secrets.USER_ALLOWED_DOMAINS }}
SALT: ${{ secrets.SALT }}
ALBERT_API_URL: ${{ secrets.ALBERT_API_URL }}
ALBERT_API_TOKEN: ${{ secrets.ALBERT_API_TOKEN }}
ALBERT_API_MODEL_NAME: ${{ secrets.ALBERT_API_MODEL_NAME }}
ALBERT_API_MODE: ${{ secrets.ALBERT_API_MODE }}
with:
host: ${{ secrets.CI_DEPLOY_HOST }}
username: ${{ secrets.CI_DEPLOY_USER }}
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ jobs:
cp ./Dockerfile ./${{ env.CI_JOB_ID }}/Dockerfile
cp ./pyproject.toml ./${{ env.CI_JOB_ID }}/pyproject.toml
- name: Create .env file with current secrets
run: |
cd ./${{ env.CI_JOB_ID }}
touch .env
echo API_ENDPOINT="https://xxx.execute-api.us-west-2.amazonaws.com" >> .env
echo API_KEY=${{ secrets.API_KEY }} >> .env
echo MATRIX_HOME_SERVER=${{ secrets.MATRIX_HOME_SERVER }} >> .env
echo MATRIX_BOT_USERNAME=${{ secrets.MATRIX_BOT_USERNAME }} >> .env
echo MATRIX_BOT_PASSWORD=${{ secrets.MATRIX_BOT_PASSWORD }} >> .env
echo ERRORS_ROOM_ID=${{ secrets.ERRORS_ROOM_ID }} >> .env
echo USER_ALLOWED_DOMAINS=${{ secrets.USER_ALLOWED_DOMAINS }} >> .env
echo SALT=${{ secrets.SALT }} >> .env
echo ALBERT_API_URL=${{ secrets.ALBERT_API_URL }} >> .env
echo ALBERT_API_TOKEN=${{ secrets.ALBERT_API_TOKEN }} >> .env
echo ALBERT_API_MODEL_NAME=${{ secrets.ALBERT_API_MODEL_NAME }} >> .env
echo ALBERT_API_MODE=${{ secrets.ALBERT_API_MODE }} >> .env
cat .env
- name: Copy deployment files to remote server via SCP
uses: appleboy/scp-action@master
with:
Expand All @@ -59,17 +77,6 @@ jobs:

- name: Execute server commands for deploy
uses: appleboy/ssh-action@master
env:
MATRIX_HOME_SERVER: ${{ secrets.MATRIX_HOME_SERVER }}
MATRIX_BOT_USERNAME: ${{ secrets.MATRIX_BOT_USERNAME }}
MATRIX_BOT_PASSWORD: ${{ secrets.MATRIX_BOT_PASSWORD }}
ERRORS_ROOM_ID: ${{ secrets.ERRORS_ROOM_ID }}
USER_ALLOWED_DOMAINS: ${{ secrets.USER_ALLOWED_DOMAINS }}
SALT: ${{ secrets.SALT }}
ALBERT_API_URL: ${{ secrets.ALBERT_API_URL }}
ALBERT_API_TOKEN: ${{ secrets.ALBERT_API_TOKEN }}
ALBERT_API_MODEL_NAME: ${{ secrets.ALBERT_API_MODEL_NAME }}
ALBERT_API_MODE: ${{ secrets.ALBERT_API_MODE }}
with:
host: ${{ secrets.CI_DEPLOY_HOST }}
username: ${{ secrets.CI_DEPLOY_USER }}
Expand All @@ -84,4 +91,4 @@ jobs:
docker compose down
docker compose up --detach
rm -rf /home/${{ secrets.CI_DEPLOY_USER }}/${{ env.CI_JOB_ID }}

0 comments on commit 9e1e1e9

Please sign in to comment.