|
| 1 | +name: Pull Request |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - test-* # make it be easier for contributors to test |
| 8 | + tags: |
| 9 | + - 'v*.*.*' |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - 'master' |
| 13 | + |
| 14 | +jobs: |
| 15 | + BuildCentOSJava11: |
| 16 | + runs-on: ubuntu-20.04 |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + - name: Docker meta for KubeSphere |
| 20 | + id: meta |
| 21 | + if: github.repository_owner == 'kubesphere' |
| 22 | + uses: docker/metadata-action@v3 |
| 23 | + with: |
| 24 | + images: | |
| 25 | + kubespheredev/java-11-centos7 |
| 26 | + ghcr.io/${{ github.repository_owner }}/java-11-centos7 |
| 27 | + tags: | |
| 28 | + type=schedule |
| 29 | + type=ref,event=branch |
| 30 | + type=ref,event=pr |
| 31 | + type=semver,pattern=v{{version}} |
| 32 | + type=semver,pattern=v{{major}}.{{minor}} |
| 33 | + type=semver,pattern=v{{major}} |
| 34 | + type=sha |
| 35 | + - name: Docker meta for Contributors |
| 36 | + id: metaContributors |
| 37 | + if: github.repository_owner != 'kubesphere' |
| 38 | + uses: docker/metadata-action@v3 |
| 39 | + with: |
| 40 | + images: | |
| 41 | + ghcr.io/${{ github.repository_owner }}/java-11-centos7 |
| 42 | + tags: | |
| 43 | + type=schedule |
| 44 | + type=ref,event=branch |
| 45 | + type=ref,event=pr |
| 46 | + type=semver,pattern=v{{version}} |
| 47 | + type=semver,pattern=v{{major}}.{{minor}} |
| 48 | + type=semver,pattern=v{{major}} |
| 49 | + type=sha |
| 50 | + - name: Set up QEMU |
| 51 | + uses: docker/setup-qemu-action@v1 |
| 52 | + - name: Set up Docker Buildx |
| 53 | + uses: docker/setup-buildx-action@v1 |
| 54 | + - name: Login to DockerHub |
| 55 | + if: github.event_name != 'pull_request' |
| 56 | + uses: docker/login-action@v1 |
| 57 | + with: |
| 58 | + username: ${{ secrets.DOCKER_HUB_USER }} |
| 59 | + password: ${{ secrets.DOCKER_HUB_SECRETS }} |
| 60 | + - name: Login to GHCR |
| 61 | + if: github.event_name != 'pull_request' |
| 62 | + uses: docker/login-action@v1 |
| 63 | + with: |
| 64 | + registry: ghcr.io |
| 65 | + username: ${{ github.repository_owner }} |
| 66 | + password: ${{ secrets.GHCR_TOKEN }} |
| 67 | + - name: Build and push Docker images |
| 68 | + |
| 69 | + if: github.repository_owner == 'kubesphere' |
| 70 | + with: |
| 71 | + context: java/images/centos-java11 |
| 72 | + tags: ${{ steps.meta.outputs.tags }} |
| 73 | + push: ${{ github.event_name != 'pull_request' }} |
| 74 | + labels: ${{ steps.meta.outputs.labels }} |
| 75 | + platforms: linux/amd64,linux/arm64 |
| 76 | + - name: Build and push Docker images for Contributors |
| 77 | + |
| 78 | + if: github.repository_owner != 'kubesphere' |
| 79 | + with: |
| 80 | + context: java/images/centos-java11 |
| 81 | + tags: ${{ steps.metaContributors.outputs.tags }} |
| 82 | + push: ${{ github.event_name != 'pull_request' }} |
| 83 | + labels: ${{ steps.metaContributors.outputs.labels }} |
| 84 | + platforms: linux/amd64,linux/arm64 |
| 85 | + |
| 86 | + BuildCentOSJava8: |
| 87 | + runs-on: ubuntu-20.04 |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v2 |
| 90 | + - name: Docker meta for KubeSphere |
| 91 | + id: meta |
| 92 | + if: github.repository_owner == 'kubesphere' |
| 93 | + uses: docker/metadata-action@v3 |
| 94 | + with: |
| 95 | + images: | |
| 96 | + kubespheredev/java-8-centos7 |
| 97 | + ghcr.io/${{ github.repository_owner }}/java-8-centos7 |
| 98 | + tags: | |
| 99 | + type=schedule |
| 100 | + type=ref,event=branch |
| 101 | + type=ref,event=pr |
| 102 | + type=semver,pattern=v{{version}} |
| 103 | + type=semver,pattern=v{{major}}.{{minor}} |
| 104 | + type=semver,pattern=v{{major}} |
| 105 | + type=sha |
| 106 | + - name: Docker meta for Contributors |
| 107 | + id: metaContributors |
| 108 | + if: github.repository_owner != 'kubesphere' |
| 109 | + uses: docker/metadata-action@v3 |
| 110 | + with: |
| 111 | + images: | |
| 112 | + ghcr.io/${{ github.repository_owner }}/java-8-centos7 |
| 113 | + tags: | |
| 114 | + type=schedule |
| 115 | + type=ref,event=branch |
| 116 | + type=ref,event=pr |
| 117 | + type=semver,pattern=v{{version}} |
| 118 | + type=semver,pattern=v{{major}}.{{minor}} |
| 119 | + type=semver,pattern=v{{major}} |
| 120 | + type=sha |
| 121 | + - name: Set up QEMU |
| 122 | + uses: docker/setup-qemu-action@v1 |
| 123 | + - name: Set up Docker Buildx |
| 124 | + uses: docker/setup-buildx-action@v1 |
| 125 | + - name: Login to DockerHub |
| 126 | + if: github.event_name != 'pull_request' |
| 127 | + uses: docker/login-action@v1 |
| 128 | + with: |
| 129 | + username: ${{ secrets.DOCKER_HUB_USER }} |
| 130 | + password: ${{ secrets.DOCKER_HUB_SECRETS }} |
| 131 | + - name: Login to GHCR |
| 132 | + if: github.event_name != 'pull_request' |
| 133 | + uses: docker/login-action@v1 |
| 134 | + with: |
| 135 | + registry: ghcr.io |
| 136 | + username: ${{ github.repository_owner }} |
| 137 | + password: ${{ secrets.GHCR_TOKEN }} |
| 138 | + - name: Build and push Docker images |
| 139 | + |
| 140 | + if: github.repository_owner == 'kubesphere' |
| 141 | + with: |
| 142 | + context: java/images/centos |
| 143 | + tags: ${{ steps.meta.outputs.tags }} |
| 144 | + push: ${{ github.event_name != 'pull_request' }} |
| 145 | + labels: ${{ steps.meta.outputs.labels }} |
| 146 | + platforms: linux/amd64,linux/arm64 |
| 147 | + - name: Build and push Docker images for Contributors |
| 148 | + |
| 149 | + if: github.repository_owner != 'kubesphere' |
| 150 | + with: |
| 151 | + context: java/images/centos |
| 152 | + tags: ${{ steps.metaContributors.outputs.tags }} |
| 153 | + push: ${{ github.event_name != 'pull_request' }} |
| 154 | + labels: ${{ steps.metaContributors.outputs.labels }} |
| 155 | + platforms: linux/amd64,linux/arm64 |
| 156 | + |
| 157 | + BuildTomcatJava8: |
| 158 | + runs-on: ubuntu-20.04 |
| 159 | + needs: BuildCentOSJava8 |
| 160 | + steps: |
| 161 | + - uses: actions/checkout@v2 |
| 162 | + - name: Docker meta for KubeSphere |
| 163 | + id: meta |
| 164 | + if: github.repository_owner == 'kubesphere' |
| 165 | + uses: docker/metadata-action@v3 |
| 166 | + with: |
| 167 | + images: | |
| 168 | + kubespheredev/tomcat85-java8-centos7 |
| 169 | + ghcr.io/${{ github.repository_owner }}/tomcat85-java8-centos7 |
| 170 | + tags: | |
| 171 | + type=schedule |
| 172 | + type=ref,event=branch |
| 173 | + type=ref,event=pr |
| 174 | + type=semver,pattern=v{{version}} |
| 175 | + type=semver,pattern=v{{major}}.{{minor}} |
| 176 | + type=semver,pattern=v{{major}} |
| 177 | + type=sha |
| 178 | + - name: Docker meta for Contributors |
| 179 | + id: metaContributors |
| 180 | + if: github.repository_owner != 'kubesphere' |
| 181 | + uses: docker/metadata-action@v3 |
| 182 | + with: |
| 183 | + images: | |
| 184 | + ghcr.io/${{ github.repository_owner }}/tomcat85-java8-centos7 |
| 185 | + tags: | |
| 186 | + type=schedule |
| 187 | + type=ref,event=branch |
| 188 | + type=ref,event=pr |
| 189 | + type=semver,pattern=v{{version}} |
| 190 | + type=semver,pattern=v{{major}}.{{minor}} |
| 191 | + type=semver,pattern=v{{major}} |
| 192 | + type=sha |
| 193 | + - name: Set up QEMU |
| 194 | + uses: docker/setup-qemu-action@v1 |
| 195 | + - name: Set up Docker Buildx |
| 196 | + uses: docker/setup-buildx-action@v1 |
| 197 | + - name: Login to DockerHub |
| 198 | + if: github.event_name != 'pull_request' |
| 199 | + uses: docker/login-action@v1 |
| 200 | + with: |
| 201 | + username: ${{ secrets.DOCKER_HUB_USER }} |
| 202 | + password: ${{ secrets.DOCKER_HUB_SECRETS }} |
| 203 | + - name: Login to GHCR |
| 204 | + if: github.event_name != 'pull_request' |
| 205 | + uses: docker/login-action@v1 |
| 206 | + with: |
| 207 | + registry: ghcr.io |
| 208 | + username: ${{ github.repository_owner }} |
| 209 | + password: ${{ secrets.GHCR_TOKEN }} |
| 210 | + - name: Build and push Docker images |
| 211 | + |
| 212 | + if: github.repository_owner == 'kubesphere' |
| 213 | + with: |
| 214 | + context: tomcat/images/tomcat85-java8-centos7 |
| 215 | + tags: ${{ steps.meta.outputs.tags }} |
| 216 | + push: ${{ github.event_name != 'pull_request' }} |
| 217 | + labels: ${{ steps.meta.outputs.labels }} |
| 218 | + platforms: linux/amd64,linux/arm64 |
| 219 | + - name: Build and push Docker images for Contributors |
| 220 | + |
| 221 | + if: github.repository_owner != 'kubesphere' |
| 222 | + with: |
| 223 | + context: tomcat/images/tomcat85-java8-centos7 |
| 224 | + tags: ${{ steps.metaContributors.outputs.tags }} |
| 225 | + push: ${{ github.event_name != 'pull_request' }} |
| 226 | + labels: ${{ steps.metaContributors.outputs.labels }} |
| 227 | + platforms: linux/amd64,linux/arm64 |
| 228 | + |
| 229 | + BuildTomcatJava11: |
| 230 | + runs-on: ubuntu-20.04 |
| 231 | + needs: BuildCentOSJava11 |
| 232 | + steps: |
| 233 | + - uses: actions/checkout@v2 |
| 234 | + - name: Docker meta for KubeSphere |
| 235 | + id: meta |
| 236 | + if: github.repository_owner == 'kubesphere' |
| 237 | + uses: docker/metadata-action@v3 |
| 238 | + with: |
| 239 | + images: | |
| 240 | + kubespheredev/tomcat85-java11-centos7 |
| 241 | + ghcr.io/${{ github.repository_owner }}/tomcat85-java11-centos7 |
| 242 | + tags: | |
| 243 | + type=schedule |
| 244 | + type=ref,event=branch |
| 245 | + type=ref,event=pr |
| 246 | + type=semver,pattern=v{{version}} |
| 247 | + type=semver,pattern=v{{major}}.{{minor}} |
| 248 | + type=semver,pattern=v{{major}} |
| 249 | + type=sha |
| 250 | + - name: Docker meta for Contributors |
| 251 | + id: metaContributors |
| 252 | + if: github.repository_owner != 'kubesphere' |
| 253 | + uses: docker/metadata-action@v3 |
| 254 | + with: |
| 255 | + images: | |
| 256 | + ghcr.io/${{ github.repository_owner }}/tomcat85-java11-centos7 |
| 257 | + tags: | |
| 258 | + type=schedule |
| 259 | + type=ref,event=branch |
| 260 | + type=ref,event=pr |
| 261 | + type=semver,pattern=v{{version}} |
| 262 | + type=semver,pattern=v{{major}}.{{minor}} |
| 263 | + type=semver,pattern=v{{major}} |
| 264 | + type=sha |
| 265 | + - name: Set up QEMU |
| 266 | + uses: docker/setup-qemu-action@v1 |
| 267 | + - name: Set up Docker Buildx |
| 268 | + uses: docker/setup-buildx-action@v1 |
| 269 | + - name: Login to DockerHub |
| 270 | + if: github.event_name != 'pull_request' |
| 271 | + uses: docker/login-action@v1 |
| 272 | + with: |
| 273 | + username: ${{ secrets.DOCKER_HUB_USER }} |
| 274 | + password: ${{ secrets.DOCKER_HUB_SECRETS }} |
| 275 | + - name: Login to GHCR |
| 276 | + if: github.event_name != 'pull_request' |
| 277 | + uses: docker/login-action@v1 |
| 278 | + with: |
| 279 | + registry: ghcr.io |
| 280 | + username: ${{ github.repository_owner }} |
| 281 | + password: ${{ secrets.GHCR_TOKEN }} |
| 282 | + - name: Build and push Docker images |
| 283 | + |
| 284 | + if: github.repository_owner == 'kubesphere' |
| 285 | + with: |
| 286 | + context: tomcat/images/tomcat85-java11-centos7 |
| 287 | + tags: ${{ steps.meta.outputs.tags }} |
| 288 | + push: ${{ github.event_name != 'pull_request' }} |
| 289 | + labels: ${{ steps.meta.outputs.labels }} |
| 290 | + platforms: linux/amd64,linux/arm64 |
| 291 | + - name: Build and push Docker images for Contributors |
| 292 | + |
| 293 | + if: github.repository_owner != 'kubesphere' |
| 294 | + with: |
| 295 | + context: tomcat/images/tomcat85-java11-centos7 |
| 296 | + tags: ${{ steps.metaContributors.outputs.tags }} |
| 297 | + push: ${{ github.event_name != 'pull_request' }} |
| 298 | + labels: ${{ steps.metaContributors.outputs.labels }} |
| 299 | + platforms: linux/amd64,linux/arm64 |
0 commit comments