Files
fristydev/.gitea/workflows/deploy.yaml
T
fristy fc7de5a4db
CI / Code Health (pull_request) Successful in 8s
CI / Lint, Test & Build (pull_request) Successful in 59s
ci(deploy): use the image's buildx instead of setup-buildx-action
buildx 0.38.1 is baked into git.fristy.net/actions/runner-images. Creating a docker-container builder with the CLI keeps the registry cache (cache-from/cache-to) working without pulling the action.
2026-11-02 14:16:14 +03:00

62 lines
2.0 KiB
YAML

name: Deploy
on:
push:
branches: ["main"]
tags: ["v*"]
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: git.fristy.net
IMAGE_NAME: fristy/fristydev
jobs:
image:
name: Build & Push Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up Buildx
run: docker buildx create --name ci --driver docker-container --use
- name: Resolve tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=sha,prefix=
- name: Build & push
uses: docker/build-push-action@v6
with:
context: .
push: true
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy:
name: Trigger Deploy
needs: image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Trigger Deploy
run: |
curl --fail -X POST "${{ secrets.WEBHOOK_URL }}"