mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-04-22 20:06:18 +02:00
02e1f158bd
Bumps the github-actions group with 3 updates: [docker/login-action](https://github.com/docker/login-action), [anomalyco/opencode](https://github.com/anomalyco/opencode) and [crate-ci/typos](https://github.com/crate-ci/typos). Updates `docker/login-action` from 4.0.0 to 4.1.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/b45d80f862d83dbcd57f89517bcf500b2ab88fb2...4907a6ddec9925e35a0a9e82d7399ccc52663121) Updates `anomalyco/opencode` from 1.3.3 to 1.3.13 - [Release notes](https://github.com/anomalyco/opencode/releases) - [Commits](https://github.com/anomalyco/opencode/compare/54443bfb7e090ec3130dc972e689a3e5cc55a7f9...6314f09c14fdd6a3ab8bedc4f7b7182647551d12) Updates `crate-ci/typos` from 1.44.0 to 1.45.0 - [Release notes](https://github.com/crate-ci/typos/releases) - [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md) - [Commits](https://github.com/crate-ci/typos/compare/631208b7aac2daa8b707f55e7331f9112b0e062d...02ea592e44b3a53c302f697cddca7641cd051c3d) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: 4.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: anomalyco/opencode dependency-version: 1.3.13 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: crate-ci/typos dependency-version: 1.45.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
74 lines
2.2 KiB
YAML
74 lines
2.2 KiB
YAML
name: Build and Push donut-sync Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "donut-sync/**"
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
description: "Docker tag (e.g., v1.0.0)"
|
|
required: true
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Docker tag (e.g., v1.0.0, latest)"
|
|
required: true
|
|
default: "latest"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
REGISTRY: docker.io
|
|
IMAGE_NAME: donutbrowser/donut-sync
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #v4.0.0
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #v4.1.0
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Determine tags
|
|
id: tags
|
|
run: |
|
|
TAGS=""
|
|
INPUT_TAG="${{ inputs.tag }}"
|
|
|
|
if [ -n "$INPUT_TAG" ]; then
|
|
# Called from release workflow or manual dispatch
|
|
TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${INPUT_TAG}"
|
|
TAGS="${TAGS},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
|
|
elif [ "${{ github.event_name }}" = "push" ]; then
|
|
# Push to main (nightly): tag with nightly and commit SHA
|
|
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
|
|
TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly"
|
|
TAGS="${TAGS},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${SHORT_SHA}"
|
|
fi
|
|
|
|
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
|
|
echo "Tags: ${TAGS}"
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 #v7.0.0
|
|
with:
|
|
context: .
|
|
file: ./donut-sync/Dockerfile
|
|
push: true
|
|
tags: ${{ steps.tags.outputs.tags }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
platforms: linux/amd64,linux/arm64
|