-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (42 loc) · 1.1 KB
/
Copy pathdockerhub.yml
File metadata and controls
42 lines (42 loc) · 1.1 KB
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
name: dockerhub
on:
workflow_call:
inputs:
image:
type: string
required: false
default: ${{ github.repository }}
context:
type: string
required: false
default: "{{defaultContext}}"
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: meta
uses: docker/metadata-action@v6
id: meta
with:
images: ${{ inputs.image }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: login
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build & push
uses: docker/build-push-action@v7
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
context: ${{ inputs.context }}