chore(deps): bump dotenv to 17.2.3 (#5522) #5
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: Docker Image Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| image_base: ghcr.io/${{ github.repository }} | |
| jobs: | |
| build-image: | |
| # Builds each image in a separate job in parallel. | |
| strategy: | |
| matrix: | |
| # The docker/build-push-action uses the git repo as the docker build context instead of | |
| # cloning the repo to the action runner disk and using the disk context. For the API image | |
| # we need to set the context to just the api/ directory which the '{{defaultContext}}:api' | |
| # syntax does: https://github.com/docker/build-push-action?tab=readme-ov-file#git-context. | |
| include: | |
| - container: api | |
| docker_context: "{{defaultContext}}:api" | |
| dockerfile: Dockerfile | |
| - container: partners | |
| docker_context: "{{defaultContext}}" | |
| dockerfile: Dockerfile.sites.partners | |
| - container: public | |
| docker_context: "{{defaultContext}}" | |
| dockerfile: Dockerfile.sites.public | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Required to use image layer cache. | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3.11.1 | |
| - name: "Build and push image" | |
| uses: docker/build-push-action@v6.18.0 | |
| with: | |
| push: true | |
| cache-to: type=registry,mode=max,ref=${{ env.image_base }}/${{ matrix.container }}/container-layer-cache:latest | |
| cache-from: type=registry,ref=${{ env.image_base }}/${{ matrix.container }}/container-layer-cache:latest | |
| context: ${{ matrix.docker_context }} | |
| file: ${{ matrix.dockerfile }} | |
| tags: | | |
| ${{ env.image_base }}/${{ matrix.container }}:latest | |
| ${{ env.image_base }}/${{ matrix.container }}:gitsha-${{ github.sha }} | |
| # Connects the image to the repository: https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package. | |
| labels: org.opencontainers.image.source=https://github.com/${{ github.repository }} |