32 lines
900 B
YAML
32 lines
900 B
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract tag
|
|
id: extract
|
|
run: |
|
|
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
|
|
echo "tag=latest" >> $GITHUB_OUTPUT
|
|
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
|
TAG=${GITHUB_REF#refs/tags/}
|
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Build and Push Docker Image
|
|
run: |
|
|
docker build -t git.local.ben.io/b3nw/plex-mcp:${{ steps.extract.outputs.tag }} .
|
|
docker login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} git.local.ben.io
|
|
docker push git.local.ben.io/b3nw/plex-mcp:${{ steps.extract.outputs.tag }}
|