v0.16.0 #185
Workflow file for this run
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 backend to production | |
| on: | |
| release: | |
| types: [released] | |
| # TODO: enable when we switch to GITHUB_TOKEN | |
| # permissions: | |
| # contents: write | |
| concurrency: | |
| # If this workflow is already running, cancel it to avoid a scenario | |
| # where the older run finishes *after* the newer run and overwrites | |
| # the deployment with an older version of the app. | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| jobs: | |
| reset-release-branch: | |
| name: Update release branch | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # fetch history for all branches and tags | |
| token: ${{ secrets.GH_TOKEN }} # TODO: switch to GITHUB_TOKEN | |
| ref: release | |
| - name: Perform reset | |
| run: | | |
| git reset --hard ${{ github.ref }} | |
| git push --force origin release | |
| production-deploy: | |
| name: Deploy to Heroku | |
| runs-on: ubuntu-22.04 | |
| needs: reset-release-branch | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # fetch history for all branches and tags | |
| ref: release | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install Heroku CLI | |
| run: curl https://cli-assets.heroku.com/install.sh | sh | |
| - name: Install builds plugin | |
| run: heroku plugins:install heroku-builds | |
| - name: Build app into tarball | |
| run: | | |
| uv build --sdist | |
| - name: Create Heroku Build | |
| run: heroku builds:create -a dandi-api --source-tar dist/*.tar.gz | |
| env: | |
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
| HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }} |