Build Docker Image #195
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 Docker Image | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 2 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04${{matrix.arch=='arm64' && '-arm' || ''}} | |
| permissions: | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| distro: [ 'centos-7', 'rocky-8', 'rocky-9', 'rocky-10', 'fedora', 'ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04', 'debian-10', 'debian-11', 'debian-12', 'debian-13', 'debian-14', 'debian-sid', 'opensuse'] | |
| arch: [ 'amd64', 'arm64' ] | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR (GitHub Packages) | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| #context: ${{matrix.distro}} | |
| file: ${{matrix.distro}}/Dockerfile | |
| tags: | | |
| ghcr.io/r-devel/${{matrix.distro}}:latest_${{matrix.arch}} | |
| manifest: | |
| runs-on: ubuntu-24.04 | |
| if: always() | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| distro: [ 'centos-7', 'rocky-8', 'rocky-9', 'rocky-10', 'fedora', 'ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04', 'debian-10', 'debian-11', 'debian-12', 'debian-13', 'debian-14', 'debian-sid', 'opensuse'] | |
| needs: [build] | |
| steps: | |
| - name: Free some disk space | |
| run: rm -Rf /usr/share/dotnet /opt/ghc "/usr/local/share/boost" "$AGENT_TOOLSDIRECTORY" | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR (GitHub Packages) | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: int128/docker-manifest-create-action@v2 | |
| with: | |
| tags: | | |
| ghcr.io/r-devel/${{matrix.distro}}:latest | |
| sources: | | |
| ghcr.io/r-devel/${{matrix.distro}}:latest_amd64 | |
| ghcr.io/r-devel/${{matrix.distro}}:latest_arm64 |