gitea - testing
Some checks failed
test / test (push) Failing after 1m48s

This commit is contained in:
Ondrej Vlach 2025-01-25 16:02:06 +01:00
parent 9189325b9e
commit 262ae56e40
No known key found for this signature in database
GPG Key ID: 7F141CDACEDEE2DE
3 changed files with 47 additions and 4 deletions

View File

@ -0,0 +1,35 @@
name: test
run-name: test
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
container:
image: ovlach/docker-gitea:v0.0.2-alpha
steps:
- uses: https://github.com/actions/checkout.git@v4
- uses: actions/docker-image@main
name: Test action
id: docker_image_test
with:
deployment_login: ${{ secrets.DEPLOYMENT_PACKAGE }}
registry: 'git.nanobyte.cz'
image_name: git.nanobyte.cz/${{ github.repository_owner }}/action-test
docker_version_prefix: 'test'
docker_file: 'test/test.Dockerfile'
additional_version: ''
docker_push: false
- shell: sh
run: |
echo "${{ steps.docker_image_test.outputs.image_version }}"
echo "${{ steps.docker_image_test.outputs.image_ref }}"
if [ -z "${{ steps.docker_image_test.outputs.image_version }}" ]; then
exit 1;
fi
if [ -z "${{ steps.docker_image_test.outputs.image_ref }}" ]; then
exit 1;
fi

View File

@ -26,6 +26,10 @@ inputs:
description: 'Dockerfile'
required: false
default: 'Dockerfile'
docker_push:
description: 'Push images'
required: false
default: true
outputs:
image_version:
description: "Image version"
@ -49,7 +53,7 @@ runs:
shell: sh
- name: Store image version
id: image
run: echo "::set-output name=version::'${{ inputs.image_name }}:${{inputs.docker_version_prefix}}-${{ steps.git.outputs.short_hash }}'"
run: echo "version=${{ inputs.image_name }}:${{inputs.docker_version_prefix}}-${{ steps.git.outputs.short_hash }}" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
shell: sh
- name: Build additional args (version etc.)
id: additional_args
@ -59,9 +63,11 @@ runs:
run: |
docker build . -f ${{inputs.docker_file}} -t ${{ inputs.image_name }}:${{inputs.docker_version_prefix}}-${{ steps.git.outputs.short_hash }} ${{steps.additional_args.outputs.additional_args}} ${{ inputs.additional_args }}
if [[ "${{inputs.docker_push}}" == "true" ]]; then
docker push ${{ inputs.image_name }}:${{inputs.docker_version_prefix}}-${{ steps.git.outputs.short_hash }}
if [[ "${{inputs.additional_version}}" != "" ]]; then
git push ${{ inputs.image_name }}:${{inputs.additional_version}}-${{inputs.docker_version_prefix}}
docker push ${{ inputs.image_name }}:${{inputs.additional_version}}-${{inputs.docker_version_prefix}}
fi
fi
shell: sh

2
test/test.Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM alpine:3.21.2
RUN echo "test"