Skip to content

Deploy

Deploy #2

Workflow file for this run

name: Deploy
on:
workflow_run:
workflows:
- Integração contínua
types:
- completed
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Fetch Fly.io secrets
id: fetch_secrets
run: |
EMAIL_BACKEND=$(flyctl secrets get EMAIL_BACKEND)
EMAIL_HOST=$(flyctl secrets get EMAIL_HOST)
EMAIL_PORT=$(flyctl secrets get EMAIL_PORT)
EMAIL_USE_TLS=$(flyctl secrets get EMAIL_USE_TLS)
EMAIL_HOST_USER=$(flyctl secrets get EMAIL_HOST_USER)
EMAIL_HOST_PASSWORD=$(flyctl secrets get EMAIL_HOST_PASSWORD)
DEFAULT_FROM_EMAIL=$(flyctl secrets get DEFAULT_FROM_EMAIL)
echo "EMAIL_BACKEND=${EMAIL_BACKEND}" >> $GITHUB_ENV
echo "EMAIL_HOST=${EMAIL_HOST}" >> $GITHUB_ENV
echo "EMAIL_PORT=${EMAIL_PORT}" >> $GITHUB_ENV
echo "EMAIL_USE_TLS=${EMAIL_USE_TLS}" >> $GITHUB_ENV
echo "EMAIL_HOST_USER=${EMAIL_HOST_USER}" >> $GITHUB_ENV
echo "EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}" >> $GITHUB_ENV
echo "DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL}" >> $GITHUB_ENV
- run: flyctl deploy --remote-only
env:
EMAIL_BACKEND: ${{ env.EMAIL_BACKEND }}
EMAIL_HOST: ${{ env.EMAIL_HOST }}
EMAIL_PORT: ${{ env.EMAIL_PORT }}
EMAIL_USE_TLS: ${{ env.EMAIL_USE_TLS }}
EMAIL_HOST_USER: ${{ env.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD: ${{ env.EMAIL_HOST_PASSWORD }}
DEFAULT_FROM_EMAIL: ${{ env.DEFAULT_FROM_EMAIL }}
environment:
name: production
url: https://eventex.fly.dev