chore: skip version as a test #1
Workflow file for this run
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
name: Docker Release | ||
on: | ||
workflow_call: | ||
inputs: | ||
PROJECT: | ||
type: string | ||
required: true | ||
FULLNAME_OVERRIDE: | ||
type: string | ||
required: false | ||
default: "" | ||
GCP_REGISTRY: | ||
type: string | ||
required: false | ||
default: "eu.gcr.io" | ||
DOCKER_METADATA_OUTPUT_TAGS: | ||
type: string | ||
required: true | ||
DOCKER_METADATA_OUTPUT_ANNOTATIONS: | ||
type: string | ||
required: true | ||
DOCKER_METADATA_OUTPUT_LABELS: | ||
type: string | ||
required: true | ||
DOCKER_METADATA_OUTPUT_JSON: | ||
type: string | ||
required: true | ||
DOCKER_METADATA_OUTPUT_VERSION: | ||
type: string | ||
required: true | ||
GCP_PROJECT_ID: | ||
type: string | ||
required: true | ||
GAR_REGISTRY: | ||
type: string | ||
required: false | ||
default: "europe-west3-docker.pkg.dev" | ||
GAR_REPOSITORY: | ||
type: string | ||
required: false | ||
default: "images" | ||
secrets: | ||
GCR_JSON_KEY: | ||
required: true | ||
jobs: | ||
docker-release: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: lowercase things | ||
id: lowercase | ||
env: | ||
project: ${{inputs.PROJECT}} | ||
postfix: ${{inputs.DOCKER_IMAGE_TAG_POSTFIX}} | ||
run: | | ||
echo "project=${project,,}" >> "$GITHUB_OUTPUT" | ||
echo "postfix=${postfix,,}" >> "$GITHUB_OUTPUT" | ||
- name: download a build artifact | ||
uses: actions/[email protected] | ||
id: download | ||
with: | ||
name: artifacts_image_${{steps.lowercase.outputs.project}} | ||
- name: docker load | ||
run: docker image load --input image_${{steps.lowercase.outputs.project}}.tar | ||
- name: tag image | ||
run: | | ||
TAGS="${{inputs.DOCKER_METADATA_OUTPUT_TAGS}}" | ||
for tag in ${TAGS}; do | ||
docker tag image_${{steps.lowercase.outputs.project}}:gha "${tag}" | ||
done | ||
# - name: tag image | ||
# run: | | ||
# docker tag image_${{inputs.PROJECT}}:gha ${{ inputs.GCP_REGISTRY }}/${{ inputs.GCP_PROJECT_ID }}/${{ inputs.FULLNAME_OVERRIDE && inputs.FULLNAME_OVERRIDE || steps.lowercase.outputs.project }}:${{ inputs.DOCKER_IMAGE_TAG }}${{steps.lowercase.outputs.postfix}} | ||
# docker image ls -a | ||
- name: login to gcr | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ inputs.GCP_REGISTRY }} | ||
username: _json_key | ||
password: ${{ secrets.GCR_JSON_KEY }} | ||
- name: push to registry | ||
run: | | ||
# VERSIONS="${{DOCKER_METADATA_OUTPUT_VERSION}}" | ||
LABELS="${{DOCKER_METADATA_OUTPUT_LABELS}}" | ||
ANNOTATIONS="${{DOCKER_METADATA_OUTPUT_ANNOTATIONS}}" | ||
JSON="${{DOCKER_METADATA_OUTPUT_JSON}}" | ||
TAGS="${{inputs.DOCKER_METADATA_OUTPUT_TAGS}}" | ||
for version in ${VERSIONS}; do | ||
echo "${version}" | ||
done | ||
for label in ${LABELS}; do | ||
echo "${label}" | ||
done | ||
for annotation in ${ANNOTATIONS}; do | ||
echo "${annotation}" | ||
done | ||
for json in ${JSON}; do | ||
echo "${json}" | ||
done | ||
for tag in ${TAGS}; do | ||
echo "${tag}" | ||
# docker push ${{ inputs.GCP_REGISTRY }}/${{ inputs.GCP_PROJECT_ID }}/${{ inputs.FULLNAME_OVERRIDE && inputs.FULLNAME_OVERRIDE || steps.lowercase.outputs.project }}:${tag}${{steps.lowercase.outputs.postfix}} | ||
done |