init docker build script

This commit is contained in:
boxi committed 2026-01-01 22:12:48 +01:00
commit 1558e213d2
2 files changed
+47

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
name: Build and Push Docker Image
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: eiche:3000
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build Docker Image
env:
REGESTRY: eiche:3000
IMAGE: ${{ GITHUB_REPOSITORY }}
run: |
# Build the image with the commit hash tag
docker build -t ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER} .
# Tag the same image as "latest"
docker tag ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER} ${REGISTRY}/${IMAGE}:latest
- name: Push Docker Images
env:
REGESTRY: eiche:3000
IMAGE: ${{ GITHUB_REPOSITORY }}
run: |
docker push ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER}
docker push ${REGISTRY}/${IMAGE}:latest
- name: Log out from registry
if: always()
run: docker logout eiche:3000
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.