mirror of
https://github.com/manualdousuario/marreta.git
synced 2025-04-15 03:09:11 +00:00
96 lines
No EOL
2.6 KiB
YAML
96 lines
No EOL
2.6 KiB
YAML
name: 🛠️ Main
|
|
run-name: 🚀 Version Deployment
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*.*.*'
|
|
|
|
env:
|
|
DOCKER_REGISTRY: ghcr.io
|
|
DOCKER_IMAGE_NAME: ${{ github.repository }}
|
|
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_USERNAME }}/marreta
|
|
|
|
jobs:
|
|
docker-build:
|
|
name: 🐳 Build and Push
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🏷️ Extract version from tag
|
|
id: get_version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: 🔧 Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: 🛠️ Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
|
|
- name: 📋 Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
|
|
${{ env.DOCKERHUB_REPOSITORY }}
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=sha
|
|
|
|
- name: 🔐 Log in to GitHub Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.DOCKER_REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: 🔐 Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: 🏗️ Build and Push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
publish-release:
|
|
name: 📦 Publish Release
|
|
runs-on: ubuntu-latest
|
|
needs: docker-build
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🏷️ Extract version from tag
|
|
id: get_version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: 📝 Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
name: "🎉 Release v${{ steps.get_version.outputs.VERSION }}"
|
|
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
|
generate_release_notes: true
|
|
draft: false
|
|
prerelease: false |