Deploy #170
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 | |
on: | |
workflow_dispatch: ~ | |
jobs: | |
deploy-api: | |
name: Deploy API | |
runs-on: ubuntu-latest | |
environment: api-production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Setup Fly | |
uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull database | |
run: | | |
docker compose pull db | |
docker compose up --no-build --pull never --wait db | |
- name: Prepare and build API container | |
env: | |
SKIP_CLEANUP: 'yes' | |
run: | | |
api/prepare-api.sh | |
- name: Print import logs | |
if: ${{ always() }} | |
run: | | |
docker compose logs api-import | |
- name: Deploy | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
run: | | |
flyctl deploy --config api.fly.toml --local-only api |