Skip to content

Create LICENSE

Create LICENSE #7

---
name: Docker
on:
push:
branches: [ "main" ]
tags: [ '*' ]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set variables
id: vars
run: |
commit_timestamp=$(git show -s --format="%ci" ${{github.sha}})
echo commit $commit_timestamp
echo "commit_timestamp=${commit_timestamp}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=tag
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
build-args: |
CI_COMMIT_REF_NAME=${{ github.ref_name }}
CI_COMMIT_SHA=${{ github.sha }}
CI_COMMIT_TITLE=${{ github.event.head_commit.message }}
CI_COMMIT_TIMESTAMP=${{ steps.vars.outputs.commit_timestamp }}