This repository has been archived on 2026-06-15. You can view files and clone it, but cannot push or open issues or pull requests.
Files
MediaLore/.gitea/workflows/docker.yml
Garret Patti b3abc7ee4c
All checks were successful
Build and Push Docker Image / build (push) Successful in 9s
fix capitilization
2026-04-05 10:13:42 -04:00

41 lines
1.2 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches: [ main, dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build Docker Image
env:
BRANCH_NAME: ${{ github.ref_name }}
SHORT_HASH: ${{ github.sha }}
run: |
# Build the image with the commit hash tag
docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t gpatti/medialoreweb-app:${BRANCH_NAME} .
# Tag the same image as "latest"
docker tag gpatti/medialoreweb-app:${BRANCH_NAME} gpatti/medialoreweb-app:${BRANCH_NAME}-latest
- name: Push Docker Images
env:
BRANCH_NAME: ${{ github.ref_name }}
SHORT_HASH: ${{ github.sha }}
run: |
docker push gpatti/medialoreweb-app:${BRANCH_NAME}
docker push gpatti/medialoreweb-app:${BRANCH_NAME}-latest
- name: Log out from registry
if: always()
run: docker logout gitea.lan