feat: config readme #10
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 and Push to Artifact Registry | |
"on": | |
push: | |
branches: ["dev", "szsz-code-cleanup"] | |
tags: ["v*"] | |
env: | |
PROJECT_ID: open-targets-genetics-dev | |
REGION: europe-west1 | |
GAR_LOCATION: europe-west1-docker.pkg.dev/open-targets-genetics-dev | |
REPOSITORY: ot-orchestration | |
PYTHON_VERSION_DEFAULT: "3.10" | |
# Add "id-token" with the intended permissions. | |
jobs: | |
build-push-artifact: | |
permissions: | |
contents: "read" | |
id-token: "write" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION_DEFAULT }} | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- id: auth | |
name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
project_id: ${{ env.PROJECT_ID }} | |
#NOTE: created with https://gist.github.com/javfg#how-to-push-tagged-docker-releases-to-google-artifact-registry-with-a-github-action | |
workload_identity_provider: projects/234703259993/locations/global/workloadIdentityPools/github/providers/my-provider | |
service_account: github-actions-access@open-targets-genetics-dev.iam.gserviceaccount.com | |
- name: "Set up Cloud SDK" | |
uses: "google-github-actions/setup-gcloud@v2" | |
- name: "Use gcloud CLI" | |
run: "gcloud info" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: "Docker auth" | |
run: | | |
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet | |
- name: Build ot package with poetry | |
run: | | |
poetry install | |
poetry build --format wheel | |
- name: Get distribution file | |
run: | | |
echo "DIST=$(find dist -name 'ot_orchestration*')" >> $GITHUB_ENV | |
- name: Build and push gentropy image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: "${{ env.GAR_LOCATION }}/${{ env.REPOSITORY }}/genetics_etl:${{ github.ref_name }}" | |
context: . | |
file: docker/genetics_etl/Dockerfile | |
build-args: DIST=${{ env.DIST }} |