Build & Publish nightly #617
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Publish nightly | |
| permissions: | |
| contents: read | |
| on: | |
| schedule: | |
| # Rebuild automatically each night | |
| - cron: "4 2 * * *" | |
| jobs: | |
| build-and-testvariants: | |
| name: Build image and run tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Set up Docker | |
| # This step is required to enable the containerd image store, which is required by the cache type=gha | |
| uses: docker/setup-docker-action@0234bb73ccb40f0c430b795634f9247e2b5c2d23 # v5.2.0 | |
| with: | |
| daemon-config: | | |
| { | |
| "debug": true, | |
| "features": { | |
| "containerd-snapshotter": true | |
| } | |
| } | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| with: | |
| buildkitd-flags: --debug | |
| - name: Build nightly image for tests" | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| context: nightly | |
| load: true | |
| tags: roundcube/roundcubemail:nightly | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # does not work linux/arm/v5 AND linux/mips64le - composer does not support mips64le or armv5 nor does the php image support them on the alpine variant | |
| - name: Run tests | |
| env: | |
| ROUNDCUBEMAIL_TEST_IMAGE: roundcube/roundcubemail:nightly | |
| run: docker compose -f ./tests/docker-compose.test-apache-postgres.yml up --exit-code-from=sut --abort-on-container-exit | |
| # Only log into docker now, so we benefit from the automatic caching of upstream images. | |
| - name: Get docker hub username | |
| id: creds | |
| run: echo 'username=${{ secrets.DOCKER_PULL_USERNAME }}' >> $GITHUB_OUTPUT | |
| - name: Login to Docker Hub | |
| if: steps.creds.outputs.username != '' | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| username: ${{ secrets.DOCKER_PULL_USERNAME }} | |
| password: ${{ secrets.DOCKER_PUSH_PASSWORD }} | |
| - name: Build and push nightly images for all platforms | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| context: nightly | |
| platforms: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/386,linux/amd64" | |
| push: true | |
| tags: roundcube/roundcubemail:nightly |