mirror of
https://github.com/s83/docker-brudi-rclone.git
synced 2024-11-26 05:55:29 +00:00
Update main.yml
This commit is contained in:
parent
f61fd50162
commit
b93344b046
67
.github/workflows/main.yml
vendored
67
.github/workflows/main.yml
vendored
@ -1,41 +1,44 @@
|
|||||||
name: Build and Publish Docker Image
|
name: ci
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- "**"
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # Trigger on tags that start with 'v'
|
- "v*.*.*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-publish:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4
|
||||||
|
- name: Docker meta
|
||||||
- name: Setup Docker Buildx
|
id: meta
|
||||||
uses: docker/setup-buildx-action@v3.0.0
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
- name: Login to Docker Hub
|
# list of Docker images to use as base name for tags
|
||||||
uses: docker/login-action@v3.0.0
|
images: |
|
||||||
with:
|
${{ secrets.DOCKERHUB_USERNAME }}/brudi-rclone
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
# generate Docker tags based on the following events/attributes
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
- name: Tag and publish image (main branch)
|
type=semver,pattern={{version}}
|
||||||
if: github.ref == 'refs/heads/main'
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
uses: docker/build-push-action@v5.1.0
|
type=semver,pattern={{major}}
|
||||||
with:
|
type=sha
|
||||||
push: true
|
- name: Set up Docker Buildx
|
||||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/brudi-rclone:latest
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Login to Docker Hub
|
||||||
- name: Tag and publish image (git tags)
|
if: github.event_name != 'pull_request'
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
uses: docker/login-action@v3
|
||||||
uses: docker/build-push-action@v5.1.0
|
with:
|
||||||
with:
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
push: true
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
tag: ${{ secrets.DOCKERHUB_USERNAME }}/brudi-rclone:${{ github.ref_name }}
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
Loading…
Reference in New Issue
Block a user