forked from GeoNode/geonode
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #737 from 52North/workflows/use-composite-action
Deduplicates code by using composite action
- Loading branch information
Showing
2 changed files
with
124 additions
and
101 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,85 @@ | ||
name: Builds and pushes Docker image | ||
description: Action to build and push images to docker | ||
|
||
|
||
inputs: | ||
dockerfile: | ||
description: Path to the Dockerfile | ||
default: ./Dockerfile | ||
required: false | ||
dockercontext: | ||
description: Path to the Docker context | ||
default: ./ | ||
required: false | ||
# image coordinates | ||
image: | ||
description: Name of the image to build | ||
required: true | ||
tags: | ||
description: Image Tag(s) | ||
required: false | ||
default: latest | ||
# OCI metadata annotations | ||
oci_title: | ||
description: Image Title (OCI annotation) | ||
required: true | ||
oci_description: | ||
description: Image Description (OCI annotation) | ||
required: true | ||
# registry credentials | ||
registry_username: | ||
description: The username for Docker hub sign-in | ||
required: true | ||
registry_password: | ||
description: The password for Docker hub sign-in | ||
required: true | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
uses: dorny/paths-filter@v2 | ||
id: changes | ||
with: | ||
filters: | | ||
src: | ||
- '${{ inputs.dockercontext }}/**' | ||
# - | ||
# name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
# - | ||
# name: Extract metadata (tags, labels) for Docker | ||
# id: meta | ||
# uses: docker/metadata-action@v4 | ||
# with: | ||
# images: ${{ inputs.image }} | ||
# labels: | | ||
# "org.opencontainers.image.vendor=52°North GmbH" | ||
# "org.opencontainers.image.authors=https://52North.org/" | ||
# "org.opencontainers.image.source=https://github.com/52North/geonode" | ||
# "org.opencontainers.image.description=${{ inputs.oci_description }}" | ||
# "org.opencontainers.image.title=${{ inputs.oci_title }}" | ||
# "org.opencontainers.image.licenses=GPL-3.0" | ||
# tags: | | ||
# ${{ inputs.tags }} | ||
# - | ||
# name: Login to Docker registry | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# username: ${{ inputs.registry_username }} | ||
# password: ${{ inputs.registry_password }} | ||
# - | ||
# name: Build and push | ||
# uses: docker/build-push-action@v4 | ||
# with: | ||
# context: . | ||
# file: ${{ inputs.dockerfile }} | ||
# push: true | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
# cache-from: type=registry,ref=${{ inputs.image }}:buildcache | ||
# cache-to: type=registry,ref=${{ inputs.image }}:buildcache,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