Update docker.yaml
This commit is contained in:
parent
cf1be65cb6
commit
dc38bc3ef3
18
docker.yaml
18
docker.yaml
@ -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:
|
||||
registry:
|
||||
required: false
|
||||
@ -20,23 +19,18 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build & push docker image
|
||||
runs-on: Docker
|
||||
container:
|
||||
image: docker:latest
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
||||
- name: Login to registry
|
||||
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"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- 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
|
||||
run: docker build --no-cache -t "${{inputs.image}}:$TAG" .
|
||||
|
Loading…
Reference in New Issue
Block a user