Skip to content

fix: updated link to calver.sh #12

fix: updated link to calver.sh

fix: updated link to calver.sh #12

Workflow file for this run

name: Build Image
on:
workflow_dispatch:
push:
concurrency: build-image
env:
REGISTRY: ghcr.io/
IMAGE: ${{ github.repository }}
TAG: ${{ github.sha }}
jobs:
build_deploy_cached:
runs-on: ubuntu-latest
name: Build and Deploy with Cache
steps:
- id: registry
uses: ASzc/change-string-case-action@v1
with:
string: ${{ env.REGISTRY }}
- id: image
uses: ASzc/change-string-case-action@v1
with:
string: ${{ env.IMAGE }}
- id: tag
uses: ASzc/change-string-case-action@v1
with:
string: ${{ env.TAG }}
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx
- name: Login to the Container Registry
uses: docker/login-action@v2
with:
registry: ${{ steps.registry.outputs.lowercase }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
# context: git
images: ${{ steps.registry.outputs.lowercase }}${{ steps.image.outputs.lowercase }}
tags: |
type=edge,priority=100
type=sha,priority=200
type=ref,event=tag,priority=300
type=raw,priority=150,value=latest,enable={{is_default_branch}}
- name: Build Image
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache