You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB
YAML

name: Build image
on: [push, workflow_dispatch]
env:
ENDPOINT: "neingeist/docker-mod-terminfos"
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
-
name: Docker - Meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ env.ENDPOINT }}
tags: |
type=sha,prefix=,format=short,enable=true
type=ref,event=branch
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
-
name: Docker - Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Docker - Login to GitHub Container Registry
if: github.ref_type == 'branch'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Docker - Build and push
uses: docker/build-push-action@v3
with:
push: ${{ github.ref_type == 'branch' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}