mirror of
https://github.com/logos-storage/bittorrent-tracker.git
synced 2026-01-07 15:33:08 +00:00
ci: use common docker reusable workflow (#1)
This commit is contained in:
parent
2b405d2a2f
commit
387e7007de
54
.github/workflows/docker.yml
vendored
54
.github/workflows/docker.yml
vendored
@ -1,47 +1,27 @@
|
|||||||
name: Docker
|
name: Docker
|
||||||
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '.gitignore'
|
||||||
|
- '.dockerignore'
|
||||||
|
- '.github/**'
|
||||||
|
- '!.github/workflows/docker.yml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
|
||||||
DOCKER_FILE: docker/bittorrent-tracker.Dockerfile
|
|
||||||
DOCKER_REPO: codexstorage/bittorrent-tracker
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
build-and-push:
|
||||||
runs-on: ubuntu-22.04
|
name: Build and Push
|
||||||
steps:
|
uses: codex-storage/github-actions/.github/workflows/docker-reusable.yml@master
|
||||||
- name: Checkout
|
with:
|
||||||
uses: actions/checkout@v4
|
docker_file: docker/bittorrent-tracker.Dockerfile
|
||||||
|
dockerhub_repo: codexstorage/bittorrent-tracker
|
||||||
- name: Set up Docker Buildx
|
tag_latest: ${{ github.ref_name == github.event.repository.default_branch || startsWith(github.ref, 'refs/tags/') }}
|
||||||
uses: docker/setup-buildx-action@v3
|
secrets: inherit
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Setup Docker Metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ env.DOCKER_REPO }}
|
|
||||||
flavor: |
|
|
||||||
latest=true
|
|
||||||
tags: |
|
|
||||||
type=sha
|
|
||||||
|
|
||||||
- name: Build and Push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ${{ env.DOCKER_FILE }}
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user