Update golang Docker tag to v1.26.5 #696
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 build | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build: | |
| name: Build image | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out repository for metadata | |
| uses: actions/checkout@v4.1.6 | |
| - name: Identify version to build | |
| id: version-meta | |
| run: | | |
| egrep "^ARG DOCKER_MACHINE_DRIVER_HETZNER_VERSION=" Dockerfile | sed "s|^ARG ||" | tee -a $GITHUB_OUTPUT | |
| echo "GITLAB_RUNNER_VERSION=$(egrep "^FROM gitlab/gitlab-runner:" Dockerfile | awk '{print $2}' | cut -d: -f2 | cut -d@ -f1)" | tee -a $GITHUB_OUTPUT | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| # set latest tag for default branch | |
| type=raw,value=latest,enable=true | |
| type=raw,value=${{ | |
| steps.version-meta.outputs.GITLAB_RUNNER_VERSION | |
| }}-machine-hetzner-v${{ | |
| steps.version-meta.outputs.DOCKER_MACHINE_DRIVER_HETZNER_VERSION | |
| }},enable=true | |
| - name: Extract image name | |
| id: custom-meta | |
| run: | | |
| echo "image-name=${DOCKER_TAG%%:*}" | tee -a $GITHUB_OUTPUT | |
| env: | |
| DOCKER_TAG: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | |
| with: | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| annotations: ${{ steps.meta.outputs.annotations }} | |
| cache-from: ${{ steps.custom-meta.outputs.image-name }}:buildcache | |
| env: | |
| SOURCE_DATE_EPOCH: 0 |