Skip to content

ci: use s prefix

ci: use s prefix #3

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
branches: [ "main" ]
tags: [ "s*" ]
workflow_dispatch:
env:
IMAGE_NAME: projectdistribute/distributor
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Distributor
uses: actions/checkout@v4
with:
path: distributor
- name: Checkout Admin
uses: actions/checkout@v4
with:
repository: ProjectDistribute/admin
path: admin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=tag
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: distributor/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max