mirror of
https://github.com/s83/docker-brudi-rclone.git
synced 2024-11-30 21:45:31 +00:00
36 lines
884 B
YAML
36 lines
884 B
YAML
|
name: Build and Publish Docker Image
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- main
|
||
|
tags:
|
||
|
- 'v*' # Trigger on tags that start with 'v'
|
||
|
|
||
|
jobs:
|
||
|
build-and-publish:
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
steps:
|
||
|
- name: Checkout code
|
||
|
uses: actions/checkout@v2
|
||
|
|
||
|
- name: Set up Docker Buildx
|
||
|
uses: docker/setup-buildx-action@v1
|
||
|
|
||
|
- name: Build Docker image
|
||
|
run: |
|
||
|
docker build -t sami/brudi-rclone:${{ github.ref }} .
|
||
|
docker tag sami/brudi-rclone:${{ github.ref }} sami/brudi-rclone:latest
|
||
|
|
||
|
- name: Log in to Docker Hub
|
||
|
uses: docker/login-action@v1
|
||
|
with:
|
||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
|
|
||
|
- name: Push image to Docker Hub
|
||
|
run: |
|
||
|
docker push sami/brudi-rclone:${{ github.ref }}
|
||
|
docker push sami/brudi-rclone:latest
|