0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-08-30 07:15:31 +00:00

feat: Push image after release

This commit is contained in:
alex289 2024-05-01 11:41:47 +02:00
parent b3ccef5198
commit 9297d0883a
No known key found for this signature in database
GPG Key ID: 573F77CD2D87F863

View File

@ -3,6 +3,9 @@ name: Release
on:
workflow_dispatch:
env:
DOCKER_IMAGE: alexdev28/clean-architecture
jobs:
release:
runs-on: ubuntu-latest
@ -73,3 +76,71 @@ jobs:
labels: changelog
body: |
This PR updates the CHANGELOG.md file for the release of version ${{ steps.get_next_version.outputs.version }}.
deploy:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get previous tag
id: latestTag
run: |
name=$(git --no-pager tag --sort=creatordate | tail -1)
git checkout $name
echo "latestTag: $name"
echo "latestTag=$name" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
context: git
# tags: |
# latest
# ${{ steps.latestTag.outputs.version }}
# annotations: |
# manifest:org.opencontainers.image.version=${{ steps.latestTag.outputs.version }}
# labels: |
# org.opencontainers.image.version=${{ steps.latestTag.outputs.version }}
images: |
${{ env.DOCKER_IMAGE }}
ghcr.io/${{ github.repository }}
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.DOCKER_IMAGE }}
readme-filepath: ./Readme.md