|
| 1 | +name: Docker images release build + Docker Hub push |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - '*' |
| 8 | + |
| 9 | +env: |
| 10 | + IMAGE_BASE_NAME: 'throwtheswitch/madsciencelab' |
| 11 | + |
| 12 | + |
| 13 | +jobs: |
| 14 | + # Jobs organized for concurrent Docker image builds |
| 15 | + # Jobs build tagged and :latest images and push to Docker Hub |
| 16 | + |
| 17 | + madsciencelab: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + packages: write |
| 22 | + attestations: write |
| 23 | + id-token: write |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: 'Checkout GitHub Action' |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: 'Set up QEMU' |
| 30 | + uses: docker/setup-qemu-action@v3 |
| 31 | + |
| 32 | + - name: 'Set up Docker Buildx' |
| 33 | + uses: docker/setup-buildx-action@v3 |
| 34 | + |
| 35 | + - name: 'Login to Docker Hub' |
| 36 | + if: github.event_name != 'pull_request' |
| 37 | + uses: docker/login-action@v3 |
| 38 | + with: |
| 39 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 40 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 41 | + |
| 42 | + # Docker image: madsciencelab |
| 43 | + # Note: standard/ directory maps to madsciencelab image (no variants) |
| 44 | + - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}' |
| 45 | + uses: docker/build-push-action@v6 |
| 46 | + with: |
| 47 | + platforms: linux/amd64,linux/arm64 |
| 48 | + file: build/standard/docker/Dockerfile |
| 49 | + build-args: CONTAINER_VERSION=${{ github.ref_name }} |
| 50 | + push: ${{ github.event_name != 'pull_request' }} |
| 51 | + tags: ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}:latest |
| 52 | + |
| 53 | + madsciencelab-plugins: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + permissions: |
| 56 | + contents: read |
| 57 | + packages: write |
| 58 | + attestations: write |
| 59 | + id-token: write |
| 60 | + env: |
| 61 | + VARIANT: plugins |
| 62 | + |
| 63 | + steps: |
| 64 | + - name: 'Checkout GitHub Action' |
| 65 | + uses: actions/checkout@v4 |
| 66 | + |
| 67 | + - name: 'Set up QEMU' |
| 68 | + uses: docker/setup-qemu-action@v3 |
| 69 | + |
| 70 | + - name: 'Set up Docker Buildx' |
| 71 | + uses: docker/setup-buildx-action@v3 |
| 72 | + |
| 73 | + - name: 'Login to Docker Hub' |
| 74 | + if: github.event_name != 'pull_request' |
| 75 | + uses: docker/login-action@v3 |
| 76 | + with: |
| 77 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 78 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 79 | + |
| 80 | + # Docker image: madsciencelab-plugins |
| 81 | + - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' |
| 82 | + uses: docker/build-push-action@v6 |
| 83 | + with: |
| 84 | + platforms: linux/amd64,linux/arm64 |
| 85 | + file: build/${{ env.VARIANT }}/docker/Dockerfile |
| 86 | + build-args: CONTAINER_VERSION=${{ github.ref_name }} |
| 87 | + push: ${{ github.event_name != 'pull_request' }} |
| 88 | + tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest |
| 89 | + |
| 90 | + madsciencelab-arm-none-eabi: |
| 91 | + runs-on: ubuntu-latest |
| 92 | + permissions: |
| 93 | + contents: read |
| 94 | + packages: write |
| 95 | + attestations: write |
| 96 | + id-token: write |
| 97 | + env: |
| 98 | + VARIANT: arm-none-eabi |
| 99 | + |
| 100 | + steps: |
| 101 | + - name: 'Checkout GitHub Action' |
| 102 | + uses: actions/checkout@v4 |
| 103 | + |
| 104 | + - name: 'Set up QEMU' |
| 105 | + uses: docker/setup-qemu-action@v3 |
| 106 | + |
| 107 | + - name: 'Set up Docker Buildx' |
| 108 | + uses: docker/setup-buildx-action@v3 |
| 109 | + |
| 110 | + - name: 'Login to Docker Hub' |
| 111 | + if: github.event_name != 'pull_request' |
| 112 | + uses: docker/login-action@v3 |
| 113 | + with: |
| 114 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 115 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 116 | + |
| 117 | + # Docker image: madsciencelab-arm-none-eabi |
| 118 | + - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' |
| 119 | + uses: docker/build-push-action@v6 |
| 120 | + with: |
| 121 | + platforms: linux/amd64,linux/arm64 |
| 122 | + file: build/${{ env.VARIANT }}/docker/Dockerfile |
| 123 | + build-args: CONTAINER_VERSION=${{ github.ref_name }} |
| 124 | + push: ${{ github.event_name != 'pull_request' }} |
| 125 | + tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest |
| 126 | + |
| 127 | + madsciencelab-arm-none-eabi-plugins: |
| 128 | + runs-on: ubuntu-latest |
| 129 | + permissions: |
| 130 | + contents: read |
| 131 | + packages: write |
| 132 | + attestations: write |
| 133 | + id-token: write |
| 134 | + env: |
| 135 | + VARIANT: arm-none-eabi-plugins |
| 136 | + |
| 137 | + steps: |
| 138 | + - name: 'Checkout GitHub Action' |
| 139 | + uses: actions/checkout@v4 |
| 140 | + |
| 141 | + - name: 'Set up QEMU' |
| 142 | + uses: docker/setup-qemu-action@v3 |
| 143 | + |
| 144 | + - name: 'Set up Docker Buildx' |
| 145 | + uses: docker/setup-buildx-action@v3 |
| 146 | + |
| 147 | + - name: 'Login to Docker Hub' |
| 148 | + if: github.event_name != 'pull_request' |
| 149 | + uses: docker/login-action@v3 |
| 150 | + with: |
| 151 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 152 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 153 | + |
| 154 | + # Docker image: madsciencelab-arm-none-eabi-plugins |
| 155 | + - name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' |
| 156 | + uses: docker/build-push-action@v6 |
| 157 | + with: |
| 158 | + platforms: linux/amd64,linux/arm64 |
| 159 | + file: build/${{ env.VARIANT }}/docker/Dockerfile |
| 160 | + build-args: CONTAINER_VERSION=${{ github.ref_name }} |
| 161 | + push: ${{ github.event_name != 'pull_request' }} |
| 162 | + tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest |
| 163 | + |
0 commit comments