57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
matrix:
|
|
PHP_VERSION:
|
|
- 8
|
|
- 8.3
|
|
- 8.2
|
|
- 8.1
|
|
|
|
when:
|
|
branch:
|
|
include: [ master ]
|
|
cron: nightly
|
|
event: [ cron, release, manual ]
|
|
|
|
clone:
|
|
git:
|
|
image: woodpeckerci/plugin-git
|
|
settings:
|
|
partial: true
|
|
tags: true
|
|
|
|
steps:
|
|
cron_pre_check:
|
|
image: docker
|
|
commands:
|
|
- docker pull php:${PHP_VERSION}-fpm-alpine
|
|
- docker pull vistanarvas/simple-laravel:latest-php-${PHP_VERSION}
|
|
- BASE_IMG=$(docker inspect php:${PHP_VERSION}-fpm-alpine --format='{{.Created}}' | cut -d '.' -f 1)
|
|
- PREV_IMG=$(docker inspect vistanarvas/simple-laravel:latest-php-${PHP_VERSION} --format='{{.Created}}' | cut -d '.' -f 1)
|
|
- BASE_DATE=$(date -D "%Y-%m-%dT%H:%M:%S" -d "$BASE_IMG" +%s)
|
|
- PREV_DATE=$(date -D "%Y-%m-%dT%H:%M:%S" -d "$PREV_IMG" +%s)
|
|
- if [ "$PREV_DATE" -gt "$BASE_DATE" ]; then echo "no rebuild needed"; exit 1; fi
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
when:
|
|
cron: nightly
|
|
event: [ cron ]
|
|
|
|
gen_tags:
|
|
image: docker
|
|
commands:
|
|
- echo ${CI_COMMIT_TAG}
|
|
- git tag
|
|
- git describe --tags --abbrev=0
|
|
- ./gen-tag-list.sh $(git describe --tags --abbrev=0) php-${PHP_VERSION}
|
|
- cat tags.txt
|
|
|
|
release_alpine_build_and_publish:
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
settings:
|
|
username: vistanarvas
|
|
password:
|
|
from_secret: DOCKERHUB_TOKEN
|
|
context: ./build
|
|
repo: vistanarvas/${CI_REPO_NAME}
|
|
tags_file: tags.txt
|
|
build_args:
|
|
- BASE_VERSION=${PHP_VERSION} |