diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index 4ad2f69..4f64655 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -22,16 +22,6 @@ jobs: deploy: name: Build and Deploy release runs-on: ubuntu-latest - env: - POSTGRES_USER: ${{ secrets.POSTGRES_USER }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - POSTGRES_DB: ${{ secrets.POSTGRES_DB }} - DB_PORT: ${{ secrets.DB_PORT }} - DB_HOST: ${{ secrets.DB_HOST }} - DB_DIALECT: postgres - SERVER_PORT: 8000 - ACCESS_TOKEN_LIFETIME: 300000 - REFRESH_TOKEN_LIFETIME: 3600000 steps: - name: Checkout latest uses: actions/checkout@v3 @@ -66,6 +56,16 @@ jobs: - name: executing remote ssh commands using ssh key uses: appleboy/ssh-action@master + env: + POSTGRES_USER: ${{ secrets.POSTGRES_USER }} + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + POSTGRES_DB: ${{ secrets.POSTGRES_DB }} + DB_PORT: ${{ secrets.DB_PORT }} + DB_HOST: ${{ secrets.DB_HOST }} + DB_DIALECT: postgres + SERVER_PORT: 8000 + ACCESS_TOKEN_LIFETIME: 300000 + REFRESH_TOKEN_LIFETIME: 3600000 with: host: ${{ env.HOST }} username: ${{ env.USERNAME }} @@ -75,6 +75,9 @@ jobs: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u dice4x4 --password-stdin docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} docker rm -f ${{ env.NAME }} - docker run -dp 8084:8000 --network wndrnet --name ${{ env.NAME }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + docker run -dp 8084:8000 --network wndrnet --name ${{ env.NAME }} \ + -e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB -e DB_PORT -e DB_HOST -e DB_DIALECT -e SERVER_PORT \ + -e ACCESS_TOKEN_LIFETIME -e REFRESH_TOKEN_LIFETIME \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} docker logout diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 6afb978..4d8027d 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -20,19 +20,19 @@ jobs: deploy: name: Deploy staging runs-on: ubuntu-latest - env: - POSTGRES_USER: ${{ secrets.POSTGRES_USER_STAGE }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD_STAGE }} - POSTGRES_DB: ${{ secrets.POSTGRES_DB_STAGE }} - DB_PORT: ${{ secrets.DB_PORT_STAGE }} - DB_HOST: ${{ secrets.DB_HOST_STAGE }} - DB_DIALECT: postgres - SERVER_PORT: 8000 - ACCESS_TOKEN_LIFETIME: 300000 - REFRESH_TOKEN_LIFETIME: 3600000 steps: - name: executing remote ssh commands using ssh key uses: appleboy/ssh-action@master + env: + POSTGRES_USER: ${{ secrets.POSTGRES_USER_STAGE }} + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD_STAGE }} + POSTGRES_DB: ${{ secrets.POSTGRES_DB_STAGE }} + DB_PORT: ${{ secrets.DB_PORT_STAGE }} + DB_HOST: ${{ secrets.DB_HOST_STAGE }} + DB_DIALECT: postgres + SERVER_PORT: 8000 + ACCESS_TOKEN_LIFETIME: 300000 + REFRESH_TOKEN_LIFETIME: 3600000 with: host: ${{ env.HOST }} username: ${{ env.USERNAME }} @@ -42,6 +42,9 @@ jobs: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u dice4x4 --password-stdin docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.pull_request.number }} docker rm -f ${{ env.NAME }} - docker run -dp 8083:8000 --network wndrnet --name ${{ env.NAME }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.pull_request.number }} + docker run -dp 8083:8000 --network wndrnet --name ${{ env.NAME }} \ + -e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB -e DB_PORT -e DB_HOST -e DB_DIALECT -e SERVER_PORT \ + -e ACCESS_TOKEN_LIFETIME -e REFRESH_TOKEN_LIFETIME \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.pull_request.number }} docker logout