-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
41 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,34 @@ | ||
name: Build Docker image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
latest: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Log in to registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile | ||
ignore: DL3045,DL3007 | ||
- name: Build and push image | ||
run: | | ||
IMAGE_ID=$(echo "ghcr.io/${{ github.repository_owner }}/${{ vars.DOCKER_IMAGE_NAME }}" | tr '[A-Z]' '[a-z]') | ||
echo "IMAGE_ID=$IMAGE_ID" >> "$GITHUB_OUTPUT" | ||
docker build --tag $IMAGE_ID:${{ inputs.version }} --platform=linux/amd64 . | ||
docker push $IMAGE_ID:${{ inputs.version }} | ||
- name: Tag latest | ||
if: inputs.latest | ||
run: | | ||
docker tag $IMAGE_ID:${{ inputs.version }} $IMAGE_ID:latest --platform=linux/amd64 . | ||
docker push $IMAGE_ID:latest |
This file was deleted.
Oops, something went wrong.
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
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
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