forked from e621ng/e621ng
[CI] Add an action to build docker images
Not used here directly but will be in other repositories
This commit is contained in:
parent
7002be5a79
commit
725aca3bf8
36
.github/docker-build-and-push/action.yml
vendored
Normal file
36
.github/docker-build-and-push/action.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# Not used here but in other repos
|
||||
name: Docker Build and Push
|
||||
description: Docker Build and Push
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Github Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Generate Docker tags
|
||||
uses: docker/metadata-action@v4
|
||||
id: metadata
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=sha,format=long,prefix=
|
||||
flavor: |
|
||||
latest=true
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
||||
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
Loading…
Reference in New Issue
Block a user