Update docker.yaml

This commit is contained in:
Zakary Timson 2023-07-28 14:44:12 +00:00
parent cf1be65cb6
commit dc38bc3ef3

View File

@ -1,7 +1,6 @@
name: Build & push docker image name: Push docker image
description: Build the local docker file & push to the registry
on:
workflow_call:
inputs: inputs:
registry: registry:
required: false required: false
@ -20,23 +19,18 @@ on:
required: true required: true
type: string type: string
jobs: runs:
build: using: composite
name: Build & push docker image
runs-on: Docker
container:
image: docker:latest
steps: steps:
- name: Login to registry - name: Login to registry
run: | run: |
REGISTRY=$([ "${{inputs.registry}}" -n ] && echo "${{inputs.registry}}" || echo "$GITHUB_SERVER_URL") REGISTRY=$([ -n "${{inputs.registry}}" ] && echo "${{inputs.registry}}" || echo "$GITHUB_SERVER_URL")
echo "${{secrets.registry_pass}}" | docker login -u "${{secrets.registry_user}}" --password-stdin "$REGISTRY" echo "${{secrets.registry_pass}}" | docker login -u "${{secrets.registry_user}}" --password-stdin "$REGISTRY"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Create tag - name: Create tag
run: TAG=$([ "${{inputs.tag}}" -n ] && echo "${{inputs.tag}}" || [ "$GITHUB_REF" == "refs/heads/develop" ] && echo "latest" || echo "$GITHUB_REF_NAME" | sed -E "s/[_/]/-/g") run: TAG=$([ -n "${{inputs.tag}}" ] && echo "${{inputs.tag}}" || [ "$GITHUB_REF" == "refs/heads/develop" ] && echo "latest" || echo "$GITHUB_REF_NAME" | sed -E "s/[_/]/-/g")
- name: Build image - name: Build image
run: docker build --no-cache -t "${{inputs.image}}:$TAG" . run: docker build --no-cache -t "${{inputs.image}}:$TAG" .