Merge pull request #110 from bruin-data/ci-fix-release-target/BRU-1440 #5
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' | |
- name: install uv | |
run: pip install uv | |
- name: setup venv | |
run: uv venv && . .venv/bin/activate | |
- name: install dependencies | |
run: uv pip install -r requirements-dev.txt | |
- name: build | |
run: make build | |
- name: release | |
run: 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 | |