add publish workflow
All checks were successful
Publish Docker image / Push Docker image to Docker Hub (release) Successful in 1h6m25s
All checks were successful
Publish Docker image / Push Docker image to Docker Hub (release) Successful in 1h6m25s
This commit is contained in:
parent
8ff4aaa7c7
commit
e80aa47915
1 changed files with 47 additions and 0 deletions
47
.gitea/workflows/docker-publish.yml
Normal file
47
.gitea/workflows/docker-publish.yml
Normal file
|
@ -0,0 +1,47 @@
|
|||
name: Publish Docker image
|
||||
|
||||
env:
|
||||
DOCKER_USERNAME: jkuhl
|
||||
DOCKER_LATEST: latest
|
||||
IMAGE_NAME: jkuhl/hadrons-env
|
||||
REGISTRY: kuhl-mann.de
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: https://github.com/RouxAntoine/checkout@v4.1.8
|
||||
|
||||
- name: Log in to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ env.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PW }}
|
||||
- name: Get Meta
|
||||
id: meta
|
||||
run: |
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: | # replace it with your local IP and tags
|
||||
kuhl-mann.de/${{ env.DOCKER_USERNAME }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
|
||||
kuhl-mann.de/${{ env.DOCKER_USERNAME }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|
Loading…
Add table
Add a link
Reference in a new issue