57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
#
|
|
# Build docker image for last released version
|
|
#
|
|
|
|
name: Rebuild Last Released
|
|
run-name: ${{ gitea.actor }} running CI in the pipeline 🚀
|
|
on:
|
|
schedule:
|
|
- cron: "10 2 * * *"
|
|
|
|
jobs:
|
|
BuildLatest:
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
runs-on: cth-ubuntu-latest
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get the latest tag
|
|
id: get_last_tag
|
|
run: echo "LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
|
|
|
|
- name: Checkout latest version
|
|
run: git checkout ${{ steps.get_last_tag.outputs.LAST_TAG }}
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Check if update available
|
|
id: checkupdate
|
|
uses: lucacome/docker-image-update-checker@v2.0.0
|
|
with:
|
|
base-image: php:8.3-apache
|
|
image: zeguigui/open-report-analyzer:latest
|
|
|
|
- name: Set up docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver-opts: |
|
|
network=giteanet
|
|
if: steps.checkupdate.outputs.needs-updating == 'true'
|
|
|
|
- name: Build and push version
|
|
uses: docker/build-push-action@v5
|
|
env:
|
|
ACTIONS_RUNTIME_TOKEN: ''
|
|
with:
|
|
push: true
|
|
tags: zeguigui/open-report-analyzer:${{ steps.get_last_tag.outputs.LAST_TAG }},zeguigui/open-report-analyzer:latest
|
|
if: steps.checkupdate.outputs.needs-updating == 'true'
|