|
| 1 | +# This workflow builds a container image on top of the Python 3.14.0 RC images |
| 2 | +# with all dependencies already compiled and installed to be used in the tests |
| 3 | +# CI pipelines. |
| 4 | + |
| 5 | +name: Build Instana python-sensor-test-py3.14.0 |
| 6 | +on: |
| 7 | + workflow_dispatch: # Manual trigger. |
| 8 | + schedule: |
| 9 | + - cron: '1 0 * * 1,3' # Every Monday and Wednesday at midnight and one. |
| 10 | +env: |
| 11 | + IMAGE_NAME: python-sensor-test-py3.14.0 |
| 12 | + IMAGE_TAG: latest |
| 13 | + CONTAINER_FILE: ./Dockerfile-py3140 |
| 14 | + IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} |
| 15 | + REGISTRY_USER: ${{ github.actor }} |
| 16 | + REGISTRY_PASSWORD: ${{ github.token }} |
| 17 | +jobs: |
| 18 | + build-and-push: |
| 19 | + name: Build container image. |
| 20 | + runs-on: ubuntu-latest |
| 21 | + permissions: |
| 22 | + contents: read |
| 23 | + packages: write |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Build image |
| 28 | + id: build_image |
| 29 | + uses: redhat-actions/buildah-build@v2 |
| 30 | + with: |
| 31 | + image: ${{ env.IMAGE_NAME }} |
| 32 | + tags: ${{ env.IMAGE_TAG }} |
| 33 | + containerfiles: ${{ env.CONTAINER_FILE }} |
| 34 | + |
| 35 | + - name: Echo Outputs |
| 36 | + run: | |
| 37 | + echo "Image: ${{ steps.build_image.outputs.image }}" |
| 38 | + echo "Tags: ${{ steps.build_image.outputs.tags }}" |
| 39 | + echo "Tagged Image: ${{ steps.build_image.outputs.image-with-tag }}" |
| 40 | +
|
| 41 | + - name: Check images created |
| 42 | + run: buildah images | grep '${{ env.IMAGE_NAME }}' |
| 43 | + |
| 44 | + # Push the image to GHCR (Image Registry) |
| 45 | + - name: Push To GHCR |
| 46 | + uses: redhat-actions/push-to-registry@v2 |
| 47 | + id: push-to-ghcr |
| 48 | + with: |
| 49 | + image: ${{ steps.build_image.outputs.image }} |
| 50 | + tags: ${{ steps.build_image.outputs.tags }} |
| 51 | + registry: ${{ env.IMAGE_REGISTRY }} |
| 52 | + username: ${{ env.REGISTRY_USER }} |
| 53 | + password: ${{ env.REGISTRY_PASSWORD }} |
| 54 | + extra-args: | |
| 55 | + --disable-content-trust |
| 56 | +
|
| 57 | + - name: Print image URL |
| 58 | + run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}" |
0 commit comments