mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 18:36:38 -06:00
Merge pull request #227 from jdh313/docker-image-tags
ci: generate versioned tags
This commit is contained in:
commit
57dc976a9f
52
.github/workflows/build-and-push-image.yml
vendored
52
.github/workflows/build-and-push-image.yml
vendored
@ -2,34 +2,50 @@ name: Build and Push Image to Dockerhub and GHCR
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
|
release:
|
||||||
|
types: ["published"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
- name: Set up Docker Buildx
|
||||||
- name: Login to DockerHub
|
uses: docker/setup-buildx-action@v3
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
username: "${{ secrets.DH_USER }}"
|
username: "${{ secrets.DH_USER }}"
|
||||||
password: "${{ secrets.DH_PASS }}"
|
password: "${{ secrets.DH_PASS }}"
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
- name: Login to GitHub Container Registry
|
||||||
with:
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: "hargata"
|
username: "hargata"
|
||||||
password: "${{ secrets.GHCR_PAT }}"
|
password: "${{ secrets.GHCR_PAT }}"
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
- name: Docker Metadata
|
||||||
with:
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
context: workflow
|
||||||
|
images: |
|
||||||
|
hargata/lubelogger
|
||||||
|
ghcr.io/hargata/lubelogger
|
||||||
|
tags: |
|
||||||
|
type=edge,branch=main
|
||||||
|
type=ref,event=tag
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
hargata/lubelogger:latest
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
ghcr.io/hargata/lubelogger:latest
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user