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 7560ad9094
Some checks failed
Build and Push Docker Image / build (push) Failing after 5s
update docker repo
2026-04-05 10:06:58 -04:00

42 lines
1.3 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:
registry: gitea.lan
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 gitea.lan/gpatti/mediaLoreweb-app:${BRANCH_NAME}-${SHORT_HASH:0:5} .
# Tag the same image as "latest"
docker tag gitea.lan/gpatti/mediaLoreweb-app:${BRANCH_NAME}-${SHORT_HASH:0:5} gitea.lan/gpatti/mediaLoreweb-app:${BRANCH_NAME}-latest
- name: Push Docker Images
env:
BRANCH_NAME: ${{ github.ref_name }}
SHORT_HASH: ${{ github.sha }}
run: |
docker push gitea.lan/gpatti/mediaLoreweb-app:${BRANCH_NAME}-${SHORT_HASH:0:5}
docker push gitea.lan/gpatti/mediaLoreweb-app:${BRANCH_NAME}-latest
- name: Log out from registry
if: always()
run: docker logout gitea.lan