-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (48 loc) · 1.33 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Docker Image Deploy
on:
push:
branches: [ "master" ]
paths-ignore:
- '.github/workflows/CI.yml'
- '.github/workflows/github-pages.yaml'
- 'doc/**'
- docker-compose.yml
- log-cfg.yml
- README.md
workflow_dispatch:
concurrency:
group: "docker"
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Get cache key
id: cache_key
run: python3 scripts/get_cache_key.py --docker
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: lifegpc
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: lifegpc/pixiv_downloader
- name: Switch docker driver
run: docker buildx create --use
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
cache-from: type=gha,scope=docker-${{ steps.cache_key.outputs.cache_key }}
cache-to: type=gha,mode=max,scope=docker-${{ steps.cache_key.outputs.cache_key }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}