|
| 1 | +name: Publish Skelebot base Docker images |
| 2 | + |
| 3 | +# Run when base-images folder is modified and also allow manual run |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + paths: |
| 9 | + - 'base-images/**' |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + publish_py: |
| 14 | + name: Publish pure Python base image |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + version: ['3.9', '3.10', '3.11'] |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Set up Docker Buildx |
| 24 | + uses: docker/setup-buildx-action@v3 |
| 25 | + |
| 26 | + - name: Login to Docker Hub |
| 27 | + uses: docker/login-action@v3 |
| 28 | + with: |
| 29 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 30 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 31 | + |
| 32 | + - name: Publish image |
| 33 | + uses: docker/build-push-action@v6 |
| 34 | + with: |
| 35 | + context: base-images/python-base/${{ matrix.version }}/ |
| 36 | + tags: skelebot/python-base:${{ matrix.version }} |
| 37 | + outputs: | |
| 38 | + type=registry |
| 39 | + type=docker,dest=/tmp/skelebot_base_${{ matrix.version }}.tar |
| 40 | +
|
| 41 | + # Save 3.9 base image locally to use as base for Kerberos image |
| 42 | + - name: Cache Python 3.9 base image |
| 43 | + if: ${{ matrix.version == '3.9' }} |
| 44 | + uses: actions/upload-artifact@v4 |
| 45 | + with: |
| 46 | + name: skelebot_base_3.9 |
| 47 | + path: /tmp/skelebot_base_3.9.tar |
| 48 | + |
| 49 | + |
| 50 | + publish_py_krb: |
| 51 | + name: Publish Python Kerberos base image |
| 52 | + runs-on: ubuntu-latest |
| 53 | + needs: publish_py |
| 54 | + steps: |
| 55 | + - name: Checkout |
| 56 | + uses: actions/checkout@v4 |
| 57 | + |
| 58 | + - name: Set up Docker Buildx |
| 59 | + uses: docker/setup-buildx-action@v3 |
| 60 | + |
| 61 | + - name: Download Python 3.9 base image from cache |
| 62 | + uses: actions/download-artifact@v4 |
| 63 | + with: |
| 64 | + name: skelebot_base_3.9 |
| 65 | + path: /tmp |
| 66 | + |
| 67 | + - name: Load cached Python 3.9 base image into context |
| 68 | + run: docker load --input /tmp/skelebot_base_3.9.tar |
| 69 | + |
| 70 | + - name: Login to Docker Hub |
| 71 | + uses: docker/login-action@v3 |
| 72 | + with: |
| 73 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 74 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 75 | + |
| 76 | + - name: Publish Python Kerberos image |
| 77 | + uses: docker/build-push-action@v6 |
| 78 | + with: |
| 79 | + context: base-images/python-krb/ |
| 80 | + tags: skelebot/python-krb |
| 81 | + push: true |
0 commit comments