Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit d0101bb

Browse files
authored
Add docker-ci-tags workflow (#1062)
1 parent d87c935 commit d0101bb

2 files changed

Lines changed: 55 additions & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Hub CI
1+
name: docker-ci-latest
22

33
on:
44
push:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# https://github.com/docker/build-push-action/blob/master/docs/advanced/tags-labels.md
2+
name: docker-ci-tags
3+
4+
on:
5+
schedule:
6+
- cron: '0 10 * * *' # everyday at 10am
7+
push:
8+
branches:
9+
- '**'
10+
tags:
11+
- 'v*.*.*'
12+
pull_request:
13+
branches:
14+
- 'master'
15+
16+
jobs:
17+
docker:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v3
25+
with:
26+
# list of Docker images to use as base name for tags
27+
images: |
28+
sqlpad/sqlpad
29+
# generate Docker tags based on the following events/attributes
30+
tags: |
31+
type=schedule
32+
type=ref,event=branch
33+
type=ref,event=pr
34+
type=semver,pattern={{version}}
35+
type=semver,pattern={{major}}.{{minor}}
36+
type=semver,pattern={{major}}
37+
type=sha
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v1
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v1
42+
- name: Login to DockerHub
43+
if: github.event_name != 'pull_request'
44+
uses: docker/login-action@v1
45+
with:
46+
username: ${{ secrets.DOCKERHUB_USERNAME }}
47+
password: ${{ secrets.DOCKERHUB_TOKEN }}
48+
- name: Build and push
49+
uses: docker/build-push-action@v2
50+
with:
51+
context: .
52+
push: ${{ github.event_name != 'pull_request' }}
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)