feat: cleanup accessed videos after a MAX_AGE
using cron
#14
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: Build and Publish Docker Images | |
on: | |
push: | |
branches: ["release"] | |
# pull_request: | |
# branches: ["release"] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Docker meta for renderer | |
id: meta-renderer | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-renderer | |
tags: | | |
type=raw,value=latest | |
type=sha,prefix={{date 'YYYYMMDD'}}- | |
type=ref,event=branch | |
type=ref,event=pr | |
- name: Docker meta for web-app | |
id: meta-web | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web | |
tags: | | |
type=raw,value=latest | |
type=sha,prefix={{date 'YYYYMMDD'}}- | |
type=ref,event=branch | |
type=ref,event=pr | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push renderer | |
id: push-renderer | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./renderer | |
file: ./renderer/dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta-renderer.outputs.tags }} | |
labels: ${{ steps.meta-renderer.outputs.labels }} | |
provenance: true | |
- name: Build and push web-app | |
id: push-web | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./web | |
file: ./web/dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta-web.outputs.tags }} | |
labels: ${{ steps.meta-web.outputs.labels }} | |
provenance: true | |
- name: Extract version | |
id: version | |
run: echo "VERSION=$(date +'%Y%m%d')-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT | |
- name: Create GitHub Release | |
if: github.event_name == 'push' && github.ref == 'refs/heads/release' | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ steps.version.outputs.VERSION }} | |
name: "Release ${{ steps.version.outputs.VERSION }}" | |
body: | | |
Automated release generated on $(date +'%Y-%m-%d') | |
Docker Images: | |
- Renderer: `${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-renderer:latest` | |
- Web App: `${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web:latest` | |
Image Digests: | |
- Renderer: `${{ steps.push-renderer.outputs.digest }}` | |
- Web App: `${{ steps.push-web.outputs.digest }}` | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |