Merge pull request #103 from DoESLiverpool/develop #15
This file contains hidden or 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 production server when master is updated | |
| on: | |
| push: | |
| branches: [ master ] | |
| # Allow it to be run manually from the Github Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| # We should add a job to run the tests first... | |
| deploy: | |
| name: Deploy to organisers.doesliverpool.com | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Do deploy | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.REMOTE_HOST_PROD }} | |
| username: ${{ secrets.REMOTE_USER_PROD }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY_PROD }} | |
| port: 22 | |
| script: | | |
| cd optimism | |
| echo ${{ secrets.EMAIL_USER }} > email_user | |
| echo ${{ secrets.EMAIL_PASS }} > email_pass | |
| git pull | |
| docker compose build --build-arg OPTIMISM_API_CLIENT_SIDE_URL=${{ secrets.API_BASE_URL }} --build-arg OPTIMISM_WEBSITE_BASE_URL=${{ secrets.WEBSITE_BASE_URL }} --build-arg OPTIMISM_EMAIL_ORG_FROM_ADDR='${{ secrets.EMAIL_ORG_FROM_ADDR }}' --build-arg OPTIMISM_EMAIL_ORG_NOTIFY_ADDR='${{ secrets.EMAIL_ORG_NOTIFY_ADDR }}' --build-arg OPTIMISM_SMTP_HOST=${{ secrets.SMTP_HOST }} --build-arg OPTIMISM_SMTP_PORT=${{ secrets.SMTP_PORT }} --build-arg OPTIMISM_SMTP_SECURE=${{ secrets.SMTP_SECURE }} | |
| docker compose down | |
| docker compose up -d | |
| docker compose exec api npx knex migrate:latest --env production | |
| rm email_user | |
| rm email_pass |