Skip to content

Check and Push Updates #1445

Check and Push Updates

Check and Push Updates #1445

Workflow file for this run

name: Check and Push Updates
on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
inputs:
forced:
type: string
required: false
description: "Space-seperated version numbers to force update of"
jobs:
getversions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
cache: pip
- name: Install Requirements
run: |
python -m pip install pip wheel --upgrade
python -m pip install -r dev/requirements.txt
- name: Get Versions
id: set-matrix
run: echo "matrix=$(python3 dev/versionchecker.py --forced ${{ inputs.forced }})" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
buildversions:
needs: getversions
if: ${{ fromJSON(needs.getversions.outputs.matrix).include[0] != null }}
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.getversions.outputs.matrix) }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Dockerhub Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Github CR Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v5
with:
tags: ${{ matrix.images }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
WEBTREES_VERSION=${{ matrix.webtrees_version }}
PHP_VERSION=${{ matrix.php_version }}
push: true
- name: Update DockerHub README
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKERHUB_PASSWORD }}
with:
destination_container_repo: nathanvaughn/webtrees
provider: dockerhub
short_description: ${{ github.event.repository.description }}
# - name: Update Harbor README
# uses: christian-korneck/update-container-description-action@v1
# env:
# DOCKER_USER: ${{ secrets.NTHNVCR_USERNAME }}
# DOCKER_PASS: ${{ secrets.NTHNVCR_PASSWORD }}
# with:
# destination_container_repo: cr.nthnv.me/library/webtrees
# provider: harbor2
- name: Create Tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag : ${{ matrix.webtrees_version }}
- name: Build Release Notes
# https://trstringer.com/github-actions-multiline-strings/
run: |
echo "IMAGE_LIST<<EOF" >> $GITHUB_ENV
python3 -c "m='${{ matrix.images }}';[print(f'- {i}') for i in m.split(',')]" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ matrix.prerelease }}
tag_name: ${{ matrix.webtrees_version }}
body: |
Automated release for webtrees version ${{ matrix.webtrees_version }}: ${{ matrix.src_url }}
Tags pushed:
${{ env.IMAGE_LIST }}