-
Notifications
You must be signed in to change notification settings - Fork 32
54 lines (47 loc) · 1.48 KB
/
ci.yaml
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
52
53
54
name: CI
on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "*" ]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
labels: |
maintainer=The Dockage Developers
images: |
dockage/tor-privoxy
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=pr
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build images
uses: docker/bake-action@v2
with:
push: ${{ github.ref_name == github.event.repository.default_branch }}
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
if: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
short-description: ${{ github.event.repository.description }}