ytdl-web/.gitea/workflows/release.yaml

62 lines
2.0 KiB
YAML
Raw Normal View History

2023-08-14 19:26:48 -04:00
---
name: Release
2023-08-14 19:26:48 -04:00
# yamllint disable-line rule:truthy
on:
push:
tags:
- "*"
jobs:
2023-08-14 19:26:48 -04:00
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
- uses: github.com/goreleaser/goreleaser-action@v2
with:
version: latest
args: release --snapshot --clean
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
2023-08-14 19:26:48 -04:00
docker:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: git.fifitido.net/apps/ytdl-web
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=pep440,pattern={{version}}
type=sha
- name: Setup QEMU
uses: github.com/docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: github.com/docker/setup-buildx-action@v2
- name: Login to Docker Registry
uses: github.com/docker/login-action@v2
with:
registry: git.fifitido.net
username: ${{ gitea.repository_owner }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Build and push
uses: github.com/docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# yamllint disable rule:line-length
build-args: |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
BUILD=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
BUILT_BY=Gitea Actions
# yamllint enable rule:line-length