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:
|
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" .
|
||||||
|
Loading…
Reference in New Issue
Block a user