Skip to content

update-bot

update-bot #685

Workflow file for this run

name: update-bot
on:
schedule:
- cron: "30 23 * * *"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
outputs:
is_update: ${{ steps.check_ver.outputs.is_update }}
stable_ver: ${{ steps.check_ver.outputs.stable_ver }}
docker_tags: ${{ steps.check_ver.outputs.docker_tags }}
steps:
- name: Check version
id: check_ver
uses: mogeko/[email protected]
with:
repo: Wind4/vlmcsd
build:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.is_update == 'true'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: redhat-actions/podman-login@v1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub Container Registry
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ secrets.DOCKER_USERNAME }}/vlmcsd
ghcr.io/${{ github.actor }}/vlmcsd
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
${{ needs.check.outputs.docker_tags }}
- name: Build container with rootless by Buildah
uses: redhat-actions/buildah-build@v2
id: build-image
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
containerfiles: ./Dockerfile
build-args: |
VERSION=${{ needs.check.outputs.stable_ver }}
layers: false
- name: Push to Container registry
uses: redhat-actions/push-to-registry@v2
with:
images: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}