Skip to content

Commit

Permalink
🐳 Add Docker meta action to workflow. (#184)
Browse files Browse the repository at this point in the history
* 🐳 Add Docker meta action to workflow.

* πŸ”– Add version tagging for releases.

* πŸ”§ Adjust workflow to trigger on exact matching branch and tag names.
  • Loading branch information
gregkonush authored Aug 24, 2024
1 parent ef8466c commit 347e931
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/docker-build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,41 @@ on:
push:
branches:
- "main"
tags:
- "v*.*.*"

jobs:
docker:
runs-on: arc-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
gitea.proompteng.ai/d/lab/ecran
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -28,7 +56,8 @@ jobs:
context: ./apps/ecran
file: ./apps/ecran/Dockerfile
push: true
tags: gitea.proompteng.ai/d/lab/ecran:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=gitea.proompteng.ai/d/lab/ecran:latest
cache-to: type=inline
- name: Build and push ledos
Expand Down

0 comments on commit 347e931

Please sign in to comment.