Skip to content

Commit

Permalink
chore(ci): extract version from dockerfile (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd authored Nov 8, 2023
2 parents 8a626a5 + 1c92c85 commit ee6c061
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 61 deletions.
56 changes: 13 additions & 43 deletions .github/workflows/publish-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,81 +28,42 @@ jobs:
include:
- name: traefik
path: traefik/1
version:
short: 1
full: 1.7.34

- name: traefik
path: traefik/3
version:
short: 3
full: 3.0.0-beta4

- name: alpine
path: alpine
version:
short: 3
full: 3.17

- name: nocodb
path: nocodb
version:
short: 0
full: 0.202.5

- name: php
path: php/7.4-apache
version:
short: 7-apache
full: 7.4-apache

- name: php
path: php/7.4-fpm
version:
short: 7
full: 7.4

- name: php
path: php/8.2-fpm
version:
short: 8
full: 8.2

- name: adminer
path: adminer
version:
short: 4
full: 4.8-3.24.4

- name: mariadb
path: mariadb/11
version:
short: 11
full: 11.0-3.26.4

- name: mariadb
path: mariadb/10
version:
short: 10
full: 10.9-3.26.4

- name: wordpress
path: wordpress/php7.4
version:
short: 6-php7
full: 6.1-php7.4-fpm

- name: wordpress
path: wordpress/php8.2
version:
short: 6
full: 6.3-php8.2-fpm

- name: tdlib
path: tdlib
version:
short: 1
full: 1.8.0

permissions:
contents: read
Expand All @@ -121,6 +82,15 @@ jobs:
container_folder:
./${{ matrix.path }}/*
- name: 🏗 Extract version from dockerfile
if: ${{ steps.file_change.outputs.container_folder == 'true' }}
id: version
run: |
version_full=$(grep 'cloud.alwatr.image.version.full' ./${{ matrix.path }}/Dockerfile | cut -d'"' -f2)
version_short=$(grep 'cloud.alwatr.image.version.short' ./${{ matrix.path }}/Dockerfile | cut -d'"' -f2)
echo "version_full=$version_full" >> $GITHUB_OUTPUT
echo "version_short=$version_short" >> $GITHUB_OUTPUT
- name: 🏗 Install cosign
if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder == 'true' }}
uses: sigstore/[email protected]
Expand Down Expand Up @@ -152,8 +122,8 @@ jobs:
context: ./${{matrix.path}}
push: ${{github.event_name != 'pull_request'}}
tags: |
${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{matrix.version.short}}
${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{matrix.version.full}}
${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{steps.version.outputs.version_full}}
${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{steps.version.outputs.version_short}}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
Expand All @@ -165,5 +135,5 @@ jobs:
env:
COSIGN_EXPERIMENTAL: 'true'
run: |
cosign sign --yes "${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{matrix.version.short}}@${{steps.build_and_push.outputs.digest}}"
cosign sign --yes "${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{matrix.version.full}}@${{steps.build_and_push.outputs.digest}}"
cosign sign --yes "${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{steps.version.outputs.version_full}}@${{steps.build_and_push.outputs.digest}}"
cosign sign --yes "${{env.REGISTRY}}/${{env.USER}}/${{matrix.name}}:${{steps.version.outputs.version_short}}@${{steps.build_and_push.outputs.digest}}"
4 changes: 3 additions & 1 deletion adminer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/adminer" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/adminer" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/adminer" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/adminer" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="4.8-3.24.4" \
cloud.alwatr.image.version.short="4"
12 changes: 7 additions & 5 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/alpine:3.17
FROM docker.io/library/alpine:3.17.5

ARG APK_TESTING
RUN set -ex; \
Expand All @@ -22,9 +22,9 @@ ARG BUILD_REV
ARG BUILD_DATE
LABEL org.opencontainers.image.title="alwatr/alpine" \
org.opencontainers.image.description="This is a lightweight Linux image for use in containerized applications. It includes only the necessary packages and dependencies to keep the image size small and efficient, packaged by Alwatr." \
org.opencontainers.image.base.name="docker.io/library/alpine:3.17" \
org.opencontainers.image.version="3.17" \
org.opencontainers.image.ref.name="3.17" \
org.opencontainers.image.base.name="docker.io/library/alpine:3.17.5" \
org.opencontainers.image.version="3.17.5" \
org.opencontainers.image.ref.name="3.17.5" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REV} \
Expand All @@ -35,4 +35,6 @@ LABEL org.opencontainers.image.title="alwatr/alpine" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
maintainer="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
version="3.17" \
description="This is a lightweight Linux image for use in containerized applications. It includes only the necessary packages and dependencies to keep the image size small and efficient, packaged by Alwatr."
description="This is a lightweight Linux image for use in containerized applications. It includes only the necessary packages and dependencies to keep the image size small and efficient, packaged by Alwatr." \
cloud.alwatr.image.version.full="3.17.5" \
cloud.alwatr.image.version.short="3"
4 changes: 3 additions & 1 deletion mariadb/10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/mariadb" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/mariadb" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/mariadb" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/mariadb" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="10.9-3.26.4" \
cloud.alwatr.image.version.short="10"
4 changes: 3 additions & 1 deletion mariadb/11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/mariadb" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/mariadb" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/mariadb" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/mariadb" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="10.11-3.26.4" \
cloud.alwatr.image.version.short="10.11"
5 changes: 3 additions & 2 deletions nocodb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/nocodb" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/nocodb" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/nocodb" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/nocodb" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"

org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="0.202.5" \
cloud.alwatr.image.version.short="0"
4 changes: 3 additions & 1 deletion php/7.4-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/php" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/php/7.4-apache" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/php/7.4-apache" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/php" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="7.4.33-apache" \
cloud.alwatr.image.version.short="7.4-apache"
4 changes: 3 additions & 1 deletion php/7.4-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/php" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/php" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/php" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/php" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="7.4.33-fpm" \
cloud.alwatr.image.version.short="7.4-fpm"
4 changes: 3 additions & 1 deletion php/8.2-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/php" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/php/8.2-fpm" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/php/8.2-fpm" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/php" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="8.2.11-fpm" \
cloud.alwatr.image.version.short="8.2-fpm"
4 changes: 3 additions & 1 deletion tdlib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ LABEL org.opencontainers.image.title="alwatr/tdlib" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/tdlib" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/tdlib" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/tdlib" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="1.8.0" \
cloud.alwatr.image.version.short="1"
4 changes: 3 additions & 1 deletion traefik/1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/traefik" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/traefik" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/traefik" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/traefik" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="1.7.34" \
cloud.alwatr.image.version.short="1"
4 changes: 3 additions & 1 deletion traefik/3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/traefik" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/traefik" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/traefik" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/traefik" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="3.0.0-beta4" \
cloud.alwatr.image.version.short="3"
4 changes: 3 additions & 1 deletion wordpress/php7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/wordpress" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/wordpress/php7.4" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/wordpress/php7.4" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/wordpress" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="6.1.1-php7.4-fpm" \
cloud.alwatr.image.version.short="6-php7.4"
4 changes: 3 additions & 1 deletion wordpress/php8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LABEL org.opencontainers.image.title="alwatr/wordpress" \
org.opencontainers.image.source="https://github.com/Alwatr/containers/tree/main/wordpress/php8.2" \
org.opencontainers.image.url="https://github.com/Alwatr/containers/tree/main/wordpress/php8.2" \
org.opencontainers.image.documentation="https://github.com/Alwatr/containers/tree/main/wordpress" \
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)"
org.opencontainers.image.authors="S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir/)" \
cloud.alwatr.image.version.full="6.3.2-php8.2-fpm" \
cloud.alwatr.image.version.short="6-php8.2"

0 comments on commit ee6c061

Please sign in to comment.