Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor authored Oct 29, 2023
2 parents 43ff18e + 5ab2984 commit bb25165
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/templates/publish_docker/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: publish_docker

# Were we can define the inputs that our action will accept
inputs:
platform:
required: true
github:
required: true
GITHUB_TOKEN:
required: true

runs:
using: "composite"
# Defining the action steps(Just one step to be simple)
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ inputs.GITHUB_TOKEN }}

- name: Docker meta
id: teddycloud_meta # you'll use this in the next step
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/toniebox-reverse-engineering/teddycloud
# Docker tags based on the following events/attributes
tags: |
type=schedule
type=schedule,pattern=nightly
type=schedule,pattern={{date 'YYYYMMDD'}}
type=schedule,pattern={{date 'YYYYMMDD-hhmmss' tz='Germany/Berlin'}}
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/tc_v') }}
type=raw,value=nightly,enable=${{ startsWith(github.ref, 'refs/tags/tc_nightly') }}
type=raw,value=nightly-develop,enable=${{ github.ref == 'refs/heads/develop' }}
type=ref,event=tag
type=match,pattern=tc_v(\d+),group=1
type=match,pattern=tc_v(\d+.\d+),group=1
type=match,pattern=tc_v(\d+.\d+.\d+),group=1
type=match,pattern=tc_v(\d+.\d+.\d+-\S+),group=1
- name: Build and push ${{ inputs.platform }}
uses: docker/build-push-action@v2
with:
context: .
platforms: ${{ inputs.platform }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.teddycloud_meta.outputs.tags }}
labels: ${{ steps.teddycloud_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit bb25165

Please sign in to comment.