Deploy API #31
This file contains 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 API | |
on: | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: 'Release version' | |
required: true | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'api_*.*.*' | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
jobs: | |
deploy-api: | |
name: Deploy api | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: | | |
cd src | |
flyctl deploy --config fly-api.toml --remote-only | |
deploy-worker: | |
name: Deploy worker | |
runs-on: ubuntu-latest | |
needs: deploy-api | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: | | |
cd src | |
flyctl deploy --remote-only | |
release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: deploy-worker | |
steps: | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.event.inputs.release_version }} | |
run: | | |
gh release create "$tag" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${tag#v}" \ | |
--generate-notes |