Merge pull request #116 from bruin-data/patch/use-project-id-for-bq-dest #10
Workflow file for this run
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: "Release ingestr on pip and ghcr.io" | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
tests: | |
uses: ./.github/workflows/tests.yml | |
pip-release: | |
runs-on: ubuntu-latest | |
needs: tests | |
env: | |
TWINE_PASSWORD: ${{ secrets.PYPI_INGESTR_TOKEN }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
# github actions invoke a fresh shell | |
# for each step. This causes us to lose our | |
# venv context. So we run all our build commands | |
# in a single step to simplify our pipeline. | |
- name: build and release | |
run: | | |
pip install uv | |
uv venv | |
source .venv/bin/activate | |
uv pip install -r requirements-dev.txt | |
make build | |
make upload-release | |
docker-release: | |
needs: tests | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/arm64/v8 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |