From ed3fdac67227409e284a2d21c122db0b4a8c062b Mon Sep 17 00:00:00 2001 From: Aditya Prima Date: Sat, 23 Mar 2024 23:52:21 +0700 Subject: [PATCH] Updated all workflows --- .gitea/workflows/alpine.yaml | 73 ++++++++++++++++++++++++++++++++++++ Dockerfile.alpine | 15 ++++++++ Dockerfile.ubuntu | 7 +--- 3 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 .gitea/workflows/alpine.yaml diff --git a/.gitea/workflows/alpine.yaml b/.gitea/workflows/alpine.yaml new file mode 100644 index 0000000..3e04d93 --- /dev/null +++ b/.gitea/workflows/alpine.yaml @@ -0,0 +1,73 @@ +name: Build and Push alpine Image +on: + push: + branches: + - master + +jobs: + build: + name: Build and push image + runs-on: alpine-latest + container: + image: ghcr.io/catthehacker/alpine:act-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Login to Docker Winter Access Git Registry + uses: docker/login-action@v3 + with: + registry: git.winteraccess.id + username: aditya.prima + password: ${{ secrets.PATOKEN }} + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: docker.io + username: aprimediet + password: ${{ secrets.DOCKER_TOKEN }} + - name: Build and push 2.2.23@php5.6 + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.alpine + build-args: | + PHP_VERSION=5.6 + COMPOSER_VERSION=2.2.23 + push: true + tags: | + git.winteraccess.id/${{ gitea.repository }}:2.2.23-alpine-php5.6 + aprimediet/composer:2.2.23-alpine-php5.6 + - name: Build and push 2.2.23@php7.4 + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.alpine + build-args: | + PHP_VERSION=7.4 + COMPOSER_VERSION=2.2.23 + push: true + tags: | + git.winteraccess.id/${{ gitea.repository }}:2.2.23 + git.winteraccess.id/${{ gitea.repository }}:2.2.23-alpine + git.winteraccess.id/${{ gitea.repository }}:2.2.23-alpine-php7.4 + aprimediet/composer:2.2.23 + aprimediet/composer:2.2.23-alpine + aprimediet/composer:2.2.23-alpine-php7.4 + - name: Build and push 2.7.2@php8.3 + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.alpine + build-args: | + PHP_VERSION=8.3 + COMPOSER_VERSION=2.7.2 + push: true + tags: | + git.winteraccess.id/${{ gitea.repository }}:2.7.2 + git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine + git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine-php8.3 + git.winteraccess.id/${{ gitea.repository }}:latest-alpine + aprimediet/composer:2.7.2 + aprimediet/composer:2.7.2-alpine + aprimediet/composer:2.7.2-alpine-php8.3 + aprimediet/composer:latest-alpine diff --git a/Dockerfile.alpine b/Dockerfile.alpine index e69de29..283ba9b 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -0,0 +1,15 @@ +ARG PHP_VERSION=8.3 +ARG REGISTRY_URL=git.winteraccess.id/docker + +FROM ${REGISTRY_URL}/php:${PHP_VERSION}-alpine +LABEL maintainer=" aprimediet@gmail.com" + +ARG COMPOSER_VERSION=2.7.2 + +WORKDIR /tmp + +USER root + +# DOWNLOAD AND INSTALL COMPOSER +ADD https://getcomposer.org/installer ./composer-setup.php +RUN php composer-setup.php --version=${COMPOSER_VERSION} && mv composer.phar /usr/local/bin/composer && rm -f ./composer-setup.php diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 9b4cb1d..4bd5da7 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -4,17 +4,12 @@ ARG REGISTRY_URL=git.winteraccess.id/docker FROM ${REGISTRY_URL}/php:${PHP_VERSION}-ubuntu LABEL maintainer=" aprimediet@gmail.com" -ARG PHP_VERSION=8.3 ARG COMPOSER_VERSION=2.7.2 WORKDIR /tmp USER root -# DOWNLOAD COMPOSER +# DOWNLOAD AND INSTALL COMPOSER ADD https://getcomposer.org/installer ./composer-setup.php - RUN php composer-setup.php --version=${COMPOSER_VERSION} && mv composer.phar /usr/local/bin/composer && rm -f ./composer-setup.php - -# CLEAN APT CACHES -RUN apt -y clean \ No newline at end of file