|
| 1 | +--- |
| 2 | +name: python image |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - "python/**" |
| 9 | + - ".github/workflows/python.yaml" |
| 10 | + workflow_dispatch: |
| 11 | +env: |
| 12 | + REGISTRY: "ghcr.io" |
| 13 | + NAMESPACE: "mskarbek/containers" |
| 14 | + IMAGE_NAME: "python" |
| 15 | + VERSION: "3.12.12" |
| 16 | +jobs: |
| 17 | + build-and-push-image: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + packages: write |
| 22 | + attestations: write |
| 23 | + id-token: write |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v5 |
| 26 | + - uses: docker/login-action@v3 |
| 27 | + with: |
| 28 | + registry: ${{ env.REGISTRY }} |
| 29 | + username: ${{ github.actor }} |
| 30 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + - id: meta |
| 32 | + uses: docker/metadata-action@v5 |
| 33 | + with: |
| 34 | + images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }} |
| 35 | + tags: | |
| 36 | + type=raw,value=${{ env.VERSION }} |
| 37 | + - id: push |
| 38 | + uses: docker/build-push-action@v5 |
| 39 | + with: |
| 40 | + context: ./python/ |
| 41 | + file: ./python/Containerfile |
| 42 | + push: true |
| 43 | + tags: ${{ steps.meta.outputs.tags }} |
| 44 | + labels: ${{ steps.meta.outputs.labels }} |
| 45 | + build-and-push-devel-image: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + permissions: |
| 48 | + contents: read |
| 49 | + packages: write |
| 50 | + attestations: write |
| 51 | + id-token: write |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v5 |
| 54 | + - uses: docker/login-action@v3 |
| 55 | + with: |
| 56 | + registry: ${{ env.REGISTRY }} |
| 57 | + username: ${{ github.actor }} |
| 58 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + - id: meta |
| 60 | + uses: docker/metadata-action@v5 |
| 61 | + with: |
| 62 | + images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}-devel |
| 63 | + tags: | |
| 64 | + type=raw,value=${{ env.VERSION }} |
| 65 | + - id: push |
| 66 | + uses: docker/build-push-action@v5 |
| 67 | + with: |
| 68 | + context: ./python/ |
| 69 | + file: ./python/Containerfile.devel |
| 70 | + push: true |
| 71 | + tags: ${{ steps.meta.outputs.tags }} |
| 72 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments