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

61 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: https://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=semver,pattern={{version}}
2023-08-14 19:26:48 -04:00
type=sha
- name: Setup QEMU
uses: https://github.com/docker/setup-qemu-action@v2
2023-08-14 19:26:48 -04:00
- name: Setup Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v2
2023-08-14 19:26:48 -04:00
- name: Login to Docker Registry
uses: https://github.com/docker/login-action@v2
2023-08-14 19:26:48 -04:00
with:
registry: git.fifitido.net
username: ${{ gitea.repository_owner }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Build and push
uses: https://github.com/docker/build-push-action@v4
2023-08-14 19:26:48 -04:00
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