Merge pull request #908 from basedosdados/staging/fix-anatel-time-out #4115
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: Build Docker image | |
on: | |
push: | |
branches: [main] | |
paths: | |
- .github/workflows/cd.yaml | |
- pipelines/**/* | |
- pyproject.toml | |
- Dockerfile | |
pull_request: | |
branches: [main] | |
paths: | |
- .github/workflows/cd_staging.yaml | |
- pipelines/**/* | |
- pyproject.toml | |
- Dockerfile | |
env: | |
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
GH_PAT: ${{ secrets.GH_PAT }} | |
IMAGE_NAME: ghcr.io/basedosdados/prefect-flows | |
jobs: | |
build-container: | |
name: Build Docker image | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Google Cloud CLI | |
uses: google-github-actions/[email protected] | |
with: | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
export_default_credentials: true | |
- name: Build and publish Prefect Agent image | |
run: |- | |
docker build -t $IMAGE_NAME:$GITHUB_SHA . | |
docker build -t $IMAGE_NAME:latest . | |
echo $GH_PAT | docker login ghcr.io -u gabriel-milan --password-stdin | |
docker push $IMAGE_NAME:$GITHUB_SHA | |
docker push $IMAGE_NAME:latest |