2023-02-13 21:35:55 +00:00
|
|
|
name: Docker Image CI
|
|
|
|
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: mirror-to-gitea
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-09-24 14:01:33 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-13 21:35:55 +00:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-09-24 14:01:33 +01:00
|
|
|
uses: docker/login-action@v3
|
2023-02-13 21:35:55 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USER }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2024-09-24 14:01:33 +01:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-13 21:35:55 +00:00
|
|
|
with:
|
|
|
|
driver: docker-container
|
|
|
|
driver-opts: |
|
|
|
|
image=moby/buildkit:master
|
|
|
|
network=host
|
|
|
|
|
|
|
|
- name: Build and push
|
2024-09-24 14:01:33 +01:00
|
|
|
uses: docker/build-push-action@v6
|
2023-02-13 21:35:55 +00:00
|
|
|
with:
|
|
|
|
context: ./
|
|
|
|
file: ./Dockerfile
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
push: true
|
|
|
|
tags: ${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:latest
|
|
|
|
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:buildcache
|
2023-02-15 12:20:30 +00:00
|
|
|
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|