-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏗️ config(cd): Extract
package/build-publish
action.
- Loading branch information
1 parent
c4e9cdf
commit cfba48d
Showing
2 changed files
with
48 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: build-publish | ||
description: > | ||
Build and publish package to registry. | ||
inputs: | ||
|
||
context: | ||
type: string | ||
required: true | ||
|
||
package: | ||
type: string | ||
required: true | ||
|
||
runs: | ||
|
||
using: composite | ||
|
||
steps: | ||
|
||
- name: Docker meta | ||
id: meta-server | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ inputs.package }} | ||
tags: | | ||
type=ref,event=tag | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=sha,format=long | ||
type=schedule | ||
type=edge | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ${{ inputs.context }} | ||
push: true | ||
tags: ${{ steps.meta-server.outputs.tags }} | ||
labels: ${{ steps.meta-server.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters