build: Bump the ci-dependencies group across 2 directories with 5 updates #323
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
| defaults: | |
| run: | |
| shell: "bash" | |
| name: "CI" | |
| on: | |
| push: | |
| branches: ["main"] | |
| tags: ["*"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| build: | |
| name: "Verify that Docker image build well" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: "actions/checkout@v6.0.1" | |
| - name: "Cache Docker layers" | |
| uses: "actions/cache@v5.0.1" | |
| with: | |
| path: "/tmp/.buildx-cache" | |
| key: "${{ runner.os }}-buildx-${{ github.sha }}" | |
| restore-keys: | |
| ${{ runner.os }}-buildx- | |
| - name: "Login to Docker Hub" | |
| uses: "docker/login-action@v3.6.0" | |
| with: | |
| username: "${{ secrets.DOCKER_HUB_USERNAME }}" | |
| password: "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | |
| - id: "buildx" | |
| name: "Setup Docker Buildx" | |
| uses: "docker/setup-buildx-action@v3.12.0" | |
| - id: "docker_build" | |
| name: "Build Docker image" | |
| uses: "docker/build-push-action@v6.18.0" | |
| with: | |
| builder: "${{ steps.buildx.outputs.name }}" | |
| context: "./" | |
| file: "./Dockerfile" | |
| push: false | |
| tags: "${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}:latest" | |
| cache-from: "type=local,src=/tmp/.buildx-cache" | |
| cache-to: "type=local,dest=/tmp/.buildx-cache" | |
| - name: "Docker image digest" | |
| run: "echo ${{ steps.docker_build.outputs.digest }}" | |
| deploy: | |
| needs: ["build"] | |
| name: "Push Docker image to the Docker Hub" | |
| if: "${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: "actions/checkout@v6.0.1" | |
| - name: "Cache Docker layers" | |
| uses: "actions/cache@v5.0.1" | |
| with: | |
| path: "/tmp/.buildx-cache" | |
| key: "${{ runner.os }}-buildx-${{ github.sha }}" | |
| restore-keys: | |
| ${{ runner.os }}-buildx- | |
| - name: "Login to Docker Hub" | |
| uses: "docker/login-action@v3.6.0" | |
| with: | |
| username: "${{ secrets.DOCKER_HUB_USERNAME }}" | |
| password: "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | |
| - id: "buildx" | |
| name: "Setup Docker Buildx" | |
| uses: "docker/setup-buildx-action@v3.12.0" | |
| - id: "deploy_info" | |
| name: "Setup deploy info" | |
| run: | | |
| set -euo pipefail | |
| base_tag_name="${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}" | |
| tag_name="${base_tag_name}:latest" | |
| if [ "${GITHUB_REF::10}" = "refs/tags/" ]; then | |
| git_tag_name="${GITHUB_REF:10}" | |
| tag_name="${base_tag_name}:${git_tag_name}" | |
| fi | |
| echo "::set-output name=tag_name::${tag_name}" | |
| - id: "docker_build" | |
| name: "Build & push Docker image" | |
| uses: "docker/build-push-action@v6.18.0" | |
| with: | |
| builder: "${{ steps.buildx.outputs.name }}" | |
| context: "./" | |
| file: "./Dockerfile" | |
| push: true | |
| tags: "${{ steps.deploy_info.outputs.tag_name }}" | |
| cache-from: "type=local,src=/tmp/.buildx-cache" | |
| cache-to: "type=local,dest=/tmp/.buildx-cache" | |
| - name: "Docker image digest" | |
| run: "echo ${{ steps.docker_build.outputs.digest }}" |