Skip to content

build(deps): bump docker/build-push-action from 5.3.0 to 6.7.0 #3

build(deps): bump docker/build-push-action from 5.3.0 to 6.7.0

build(deps): bump docker/build-push-action from 5.3.0 to 6.7.0 #3

Workflow file for this run

name: Run Checks and Build Docker Images
on:
push:
branches:
- master
- dev
- dev-*
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-r[0-9]+"
pull_request:
branches:
- master
- dev
- dev-*
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_TAG: ${{github.ref_name == 'master' && 'latest' || github.ref_name}}
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: WillAbides/setup-go-faster@v1.14.0
with:
go-version: "1.20"
- name: Run Go tests
run: |
go test -v ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
- name: Run staticcheck
uses: dominikh/staticcheck-action@v1.3.1
with:
install-go: false
min-go-version: "1.20"
version: 2023.1.6
- name: Check test coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set target tags
id: set-tags-matrix
run: |
TAGS_JSON=$(ls Dockerfiles | jq -cnR '[inputs | select(length>0)]')
echo "matrix=$TAGS_JSON" >> $GITHUB_OUTPUT
echo "### Discovered Containers :whale:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
for title in $(echo $TAGS_JSON | jq -r '.[]'); do
echo "* $title" | tr '-' ' ' >> $GITHUB_STEP_SUMMARY
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "#### Raw" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```json' >> $GITHUB_STEP_SUMMARY
echo "$TAGS_JSON" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Get latest Version Tag
id: latest-version-tag
run: |
VERSION=$(git describe --tags --abbrev=0)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "### Sewing \`$VERSION\` as build Version" >> $GITHUB_STEP_SUMMARY
outputs:
matrix: ${{ steps.set-tags-matrix.outputs.matrix }}
version: ${{ steps.latest-version-tag.outputs.version }}
build-and-push:
runs-on: ubuntu-latest
needs: [prepare, checks]
strategy:
matrix:
tag: ${{fromJson(needs.prepare.outputs.matrix)}}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.5.1
with:
tags: type=raw,value=${{env.IMAGE_TAG}}
images: ${{ env.REGISTRY }}/infinimesh/infinimesh/${{matrix.tag}}
- name: Log in to the Container registry
uses: docker/login-action@v3.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6.7.0
id: build
with:
context: .
file: Dockerfiles/${{matrix.tag}}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"IMAGE_TAG=${{env.IMAGE_TAG}}"
"INFINIMESH_VERSION_TAG=${{needs.prepare.outputs.version}}"
- name: Summary
run: |
echo "### :whale: Published new image" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Digest:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.build.outputs.imageid }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo 'docker pull ${{ env.REGISTRY }}/infinimesh/infinimesh/${{matrix.tag}}:${{env.IMAGE_TAG}}' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "> Operator would automatically pull new image, otherwise use the command above" >> $GITHUB_STEP_SUMMARY