Cria flow para corrigir o valor do redis do gtfs #1664
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: Register flows (staging) | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/cd_staging.yaml" | |
- "pipelines/**/*" | |
- "pyproject.toml" | |
- "Dockerfile" | |
env: | |
PREFECT__BACKEND: cloud | |
PREFECT__CLOUD__API: ${{ secrets.PREFECT__CLOUD__API }} | |
PREFECT__CLOUD__PORT: ${{ secrets.PREFECT__CLOUD__PORT }} | |
PREFECT__SERVER__PROJECT: ${{ secrets.PREFECT__SERVER__PROJECT__STAGING }} | |
PREFECT_AUTH_TOML: ${{ secrets.PREFECT_AUTH_TOML }} | |
jobs: | |
build-container: | |
if: startsWith(github.head_ref, 'staging/') || contains( github.event.pull_request.labels.*.name, 'staging') | |
name: Register flows (staging) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python version | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Setup Google Cloud credentials | |
uses: google-github-actions/setup-gcloud@v0.2.1 | |
with: | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
export_default_credentials: true | |
- name: Install Python dependencies for deploying | |
run: |- | |
pip install -U pip poetry | |
poetry config virtualenvs.create false | |
poetry install --with dev --with ci | |
- name: Update image tag in constants | |
run: |- | |
python .github/workflows/scripts/replace_docker_tag.py debian ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }} ${{ github.sha }} | |
- name: Update image tag in constants | |
run: |- | |
python .github/workflows/scripts/replace_docker_tag.py fedora gcr.io/rj-smtr/pipelines-fedora ${{ github.sha }} | |
- name: Get changed filepaths | |
uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
docker_fedora: | |
- "pipelines/serpro/*" | |
- "pyproject.toml" | |
- "Dockerfile-fedora" | |
- name: Get changed files for code tree analysis | |
id: files | |
uses: Ana06/get-changed-files@v2.1.0 | |
- name: Perform code tree analysis | |
id: code-tree-analysis | |
continue-on-error: true | |
run: | | |
python .github/workflows/scripts/code_tree_analysis.py "${{ steps.files.outputs.all }}" --write-to-file | |
- name: Write auth.toml | |
run: |- | |
mkdir -p $HOME/.prefect | |
echo $PREFECT_AUTH_TOML | base64 --decode > $HOME/.prefect/auth.toml | |
- name: Wait for Docker image to be available | |
uses: lewagon/wait-on-check-action@v1.3.1 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
check-name: 'Build Docker image' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
verbose: true | |
- name: Wait for Docker Fedora image to be available | |
if: steps.filter.outputs.docker_fedora == 'true' | |
uses: lewagon/wait-on-check-action@v1.3.1 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
check-name: 'Build Fedora Image' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
verbose: true | |
- name: Register Prefect flows | |
run: |- | |
python .github/workflows/scripts/register_flows.py --project $PREFECT__SERVER__PROJECT --path pipelines/ --no-schedule --filter-affected-flows |