Skip to content

add scaffolding for tagged releases #8

add scaffolding for tagged releases

add scaffolding for tagged releases #8

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 "${{ github.sha }}" | cut -c1-7)" >> "$GITHUB_OUTPUT"
- id: tag
run: |
echo "tag=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
if: startsWith(github.ref, 'refs/tags/')
- 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 }}
RELEASE: ${{ steps.tag.outputs.tag }}