Skip to content

get docker to get the right commit count #6

get docker to get the right commit count

get docker to get the right commit count #6

Workflow file for this run

on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- id: short-sha
run: |
echo "tag=$(echo "$sha" | cut -c1-7)" >> "$GITHUB_OUTPUT"
env:
sha: ${{ github.sha }}
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: lowerify repository name
id: lowerify
run: |
echo "repository=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- name: build and push
uses: docker/bake-action@v3
with:
files: docker-bake.hcl
push: true
load: false
set: |
server.cache-from=type=gha
server.cache-to=type=gha,mode=max
env:
TAG: ${{ steps.short-sha.outputs.tag }}
IMAGE_NAME: ghcr.io/${{ steps.lowerify.outputs.repository }}