deploy.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. name: deploy-to-staging
  2. on:
  3. push:
  4. branches:
  5. - main
  6. jobs:
  7. deploy:
  8. name: "Deploy (main to staging)"
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Wait for tests to pass
  12. uses: lewagon/wait-on-check-action@v0.2
  13. with:
  14. ref: ${{ github.ref }}
  15. # check-name: "Test (on Python3.8)" # name of the job we wait for (omit to wait for all checks)
  16. running-workflow-name: "Deploy (main to staging)" # name of the check that will wait for other checks
  17. repo-token: ${{ secrets.GITHUB_TOKEN }}
  18. wait-interval: 20 # seconds
  19. - uses: actions/checkout@v3
  20. with:
  21. fetch-depth: '0'
  22. ref: 'main'
  23. - name: Install SSH key
  24. uses: shimataro/ssh-key-action@v2
  25. with:
  26. key: ${{ secrets.SSH_DEPLOYMENT_KEY }} # private ssh key
  27. known_hosts: ${{ secrets.KNOWN_DEPLOYMENT_HOSTS }} # make via ssh-keyscan -t rsa <your host>
  28. - run: ci/DEPLOY.sh
  29. env:
  30. BRANCH_NAME: main
  31. STAGING_REMOTE_REPO: ${{ secrets.STAGING_REMOTE_REPO }}