Execute jobs only on master branch, better tags for images

This commit is contained in:
Fijxu 2024-05-01 01:16:43 -04:00
parent a74057bb7a
commit a7e9602ccd
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -6,6 +6,8 @@ on:
schedule: schedule:
- cron: '0 7 * * 0' - cron: '0 7 * * 0'
push: push:
branches:
- "master"
jobs: jobs:
build: build:
@ -24,12 +26,21 @@ jobs:
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: ${{ secrets.TOKEN }} password: ${{ secrets.TOKEN }}
- name: Docker meta
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: git.nadeko.net/fijxu/invidious
tags: |
type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- uses: https://code.forgejo.org/docker/build-push-action@v5 - uses: https://code.forgejo.org/docker/build-push-action@v5
name: Build images name: Build images
with: with:
context: . context: .
file: docker/Dockerfile file: docker/Dockerfile
tags: git.nadeko.net/fijxu/invidious:latest tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64 platforms: linux/amd64
push: true push: true
build-args: | build-args: |