Skip to content

Commit

Permalink
Test building and publish docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
misje committed May 6, 2024
1 parent 68c81db commit 52ef794
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create and publish connector docker image

# TODO: Publish tagged releases too
on:
workflow_run:
workflows:
- tests
branches:
- dev
types:
- completed

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
attestations: write
steps:
- uses: actions/checkout@v4

- name: Log in to the 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: Build and push images
id: push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- .github/workflows/docs.yml
- docs/source/**
- src/**/*.py
workflow_dispatch:

jobs:
build-docs:
runs-on: ubuntu-22.04
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- .github/workflows/tests.yml
- tests/**
- src/**/*.py

workflow_dispatch:

jobs:
run-tests:
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 52ef794

Please sign in to comment.