Skip to content

[WIP] Viagens 2.0 - Cria tabela de segmentos de Shape #57

[WIP] Viagens 2.0 - Cria tabela de segmentos de Shape

[WIP] Viagens 2.0 - Cria tabela de segmentos de Shape #57

name: Build Fedora Image
on:
push:
branches:
- main
paths:
# - ".github/workflows/cd.yaml"
- "pipelines/serpro/*"
- "pyproject.toml"
- "Dockerfile-fedora"
pull_request:
branches:
- main
paths:
# - ".github/workflows/cd_staging.yaml"
- "pipelines/serpro/*"
- "pyproject.toml"
- "Dockerfile-fedora"
env:
GKE_PROJECT_ID: ${{ secrets.GKE_PROJECT_ID }}
GKE_SA_KEY: ${{ secrets.GKE_SA_KEY }}
GKE_CLUSTER: ${{ secrets.GKE_APP_CLUSTER_NAME }}
GKE_ZONE: ${{ secrets.GKE_CLUSTER_ZONE }}
IMAGE_NAME: gcr.io/rj-smtr/pipelines-fedora
jobs:
build-container:
name: Build Fedora Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python version
uses: actions/setup-python@v2
with:
python-version: "3.9"
- run: |-
pip install --no-cache-dir -r requirements.txt
# - name: Update image tag in constants
# run: |-
# python .github/workflows/scripts/replace_docker_tag.py gcr.io/${{ env.GKE_PROJECT_ID }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
# Setup gcloud CLI
- name: Setup Google Cloud CLI
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT_ID}}
export_default_credentials: true
- name: Get GKE credentials
uses: google-github-actions/[email protected]
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}
# Configure Docker to use the gcloud command-line tool as a credential
# helper for authentication
- run: |-
gcloud --quiet auth configure-docker
- name: Build and publish image
run: |
docker build -t $IMAGE_NAME:${{ github.sha}} . -f Dockerfile-fedora
docker push $IMAGE_NAME:${{ github.sha }}