Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
name: release
on:
push:
tags: ['v*'] # cuando semantic-release crea el tag
release:
types: [published]
types: [published] # cuando el GitHub Release se publica

permissions:
contents: read
packages: write

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
ghcr:
if: startsWith(github.event.release.tag_name, 'v')
runs-on: ubuntu-latest
env:
# nombre de imagen SIEMPRE en minúsculas
IMAGE: ghcr.io/${{ github.repository }}
TAG: ${{ github.ref_type == 'tag' && github.ref_name || github.event.release.tag_name }}
steps:
- uses: actions/checkout@v4

- name: Lowercase image name
run: echo "IMAGE=${IMAGE,,}" >> "$GITHUB_ENV"

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set env
run: |
echo "TAG=${{ github.event.release.tag_name }}" >> "$GITHUB_ENV"
echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
- name: Build & push (amd64+arm64)
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t "$IMAGE:$TAG" -t "$IMAGE:latest" \
--push .

- uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
provenance: false
tags: ${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ env.TAG }}
Loading