Use docker login action #47
Workflow file for this run
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: Ubuntu | |
| on: | |
| push: | |
| paths: | |
| - .github/workflows/ubuntu.yml | |
| - docker/ubuntu/Dockerfile | |
| env: | |
| CONTAINER_REGISTRY: ghcr.io | |
| DOCKER_BUILDKIT: 1 | |
| BUILDKIT_PROGRESS: plain | |
| CONAN_VERSION: 2.17.0 | |
| NONROOT_USER: ci | |
| jobs: | |
| # Build the Docker image for Ubuntu using different versions of GCC. See | |
| # https://documentation.ubuntu.com/ubuntu-for-developers/reference/availability/gcc/. | |
| gcc: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| version: | |
| - os: jammy | |
| gcc: 12 | |
| - os: noble | |
| gcc: 13 | |
| - os: noble | |
| gcc: 14 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Login to GitHub Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.CONTAINER_REGISTRY }} | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Determine the Docker image name. | |
| run: | | |
| # Convert the repository name to lowercase as the organization name is | |
| # uppercase, which is not permitted by the Docker registry. | |
| GITHUB_REPO=${{ github.repository }} | |
| CONTAINER_REPOSITORY=${GITHUB_REPO@L} | |
| echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/ubuntu-${{ matrix.version.os }}:gcc${{ matrix.version.gcc }}" >> $GITHUB_ENV | |
| - name: Build the Docker image | |
| working-directory: docker/ubuntu | |
| run: | | |
| docker build . \ | |
| --target gcc \ | |
| --build-arg BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom \ | |
| --build-arg BUILDKIT_INLINE_CACHE=1 \ | |
| --build-arg CONAN_VERSION=${{ env.CONAN_VERSION }} \ | |
| --build-arg GCC_VERSION=${{ matrix.version.gcc }} \ | |
| --build-arg GITHUB_REPO=${{ github.repository }} \ | |
| --build-arg NONROOT_USER=${{ env.NONROOT_USER }} \ | |
| --build-arg UBUNTU_VERSION=${{ matrix.version.os }} \ | |
| --tag ${{ env.CONTAINER_IMAGE }} | |
| - name: Push the Docker image | |
| run: docker push ${{ env.CONTAINER_IMAGE }} | |
| # Build the Docker image for Ubuntu using different versions of Clang. See | |
| # https://documentation.ubuntu.com/ubuntu-for-developers/reference/availability/llvm/. | |
| clang: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| version: | |
| - os: noble | |
| clang: 16 | |
| - os: noble | |
| clang: 17 | |
| - os: noble | |
| clang: 18 | |
| - os: noble | |
| clang: 19 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Login to GitHub Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.CONTAINER_REGISTRY }} | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Determine the Docker image name. | |
| run: | | |
| # Convert the repository name to lowercase as the organization name is | |
| # uppercase, which is not permitted by the Docker registry. | |
| GITHUB_REPO=${{ github.repository }} | |
| CONTAINER_REPOSITORY=${GITHUB_REPO@L} | |
| echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/ubuntu-${{ matrix.version.os }}:clang${{ matrix.version.clang }}" >> $GITHUB_ENV | |
| - name: Build the Docker image | |
| working-directory: docker/ubuntu | |
| run: | | |
| docker build . \ | |
| --target clang \ | |
| --build-arg BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom \ | |
| --build-arg BUILDKIT_INLINE_CACHE=1 \ | |
| --build-arg CLANG_VERSION=${{ matrix.version.clang }} \ | |
| --build-arg CONAN_VERSION=${{ env.CONAN_VERSION }} \ | |
| --build-arg GITHUB_REPO=${{ github.repository }} \ | |
| --build-arg NONROOT_USER=${{ env.NONROOT_USER }} \ | |
| --build-arg UBUNTU_VERSION=${{ matrix.version.os }} \ | |
| --tag ${{ env.CONTAINER_IMAGE }} | |
| - name: Push the Docker image | |
| run: docker push ${{ env.CONTAINER_IMAGE }} |