Docker-build-pmwiki-cron #68
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-build-pmwiki-cron | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
on: | |
schedule: | |
# am 10. jeden Monats um 8:37 laufen lassen (normalerweise releast pmwiki zwischen 2.-6. eines Monats | |
- cron: '37 8 10 * *' | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v*.*.*' | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
docker-job: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: get latest pmwiki version number | |
run: wget --quiet http://www.pmwiki.org/pub/pmwiki/ -O- 2>/dev/null |grep pmwiki-|egrep -v 'zip|patch|md5|latest'|sed -e 's/.*pmwiki-//' -e 's/<\/a.*//' -e 's/.tgz.*//'|sort -V|tail -1 > ./VERSION | |
shell: bash | |
- | |
name: shift pmwiki version nr. into env variable | |
run: echo "version=$(cat ./VERSION)" >> $GITHUB_ENV | |
shell: bash | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
lukystreik/volx-rz-pmwiki | |
#username/app | |
#ghcr.io/username/app | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=schedule,pattern={{date 'YYYYMMDD'}} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=raw,value=${{ env.version }},enable=true | |
#generiert grundsaetzlich eine sha Version type=sha | |
#baut version nach branch namen type=ref,event=branch | |
#baut version nach pull request namen type=ref,event=pr | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# - | |
# name: Login to GHCR | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# registry: ghcr.io | |
# username: ${{ github.repository_owner }} | |
# password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: "{{defaultContext}}:build" | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |