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