Files
headscale/.github/workflows/release.yml
T
Kristoffer Dalby 1dcb57cb8c .github: grant workflows only the permissions they use
The repository default token can write; set read and widen per job.
2026-11-20 19:47:15 +01:00

49 lines
1.1 KiB
YAML

---
name: Release
on:
push:
tags:
- "*" # triggers only if push new tag version
workflow_dispatch:
defaults:
run:
shell: nix develop --fallback --command bash -e {0}
jobs:
goreleaser:
if: github.repository == 'juanfont/headscale'
runs-on: ubuntu-latest
permissions:
# The GitHub release.
contents: write
# ko pushes to ghcr.io.
packages: write
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- name: Login to DockerHub
uses: docker/login-action@v4.8.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v4.8.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: NixOS/nix-installer-action@v1.0.0
- uses: Mic92/hestia@v3.1.0
- name: Run goreleaser
run: goreleaser release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}