-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.17 KB
/
callable-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
name: "Callable Docker"
on:
workflow_call:
inputs:
cache-key:
required: true
type: string
environment:
required: true
type: string
secrets:
DOCKERHUB_USER:
required: true
DOCKERHUB_ACCESS_TOKEN:
required: true
DOCKERHUB_REPOSITORY:
required: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout Git
uses: actions/checkout@v4
- name: Download from cache
uses: actions/cache@v4
with:
path: ./target
key: ${{ inputs.cache-key }}
fail-on-cache-miss: true
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Build and Push Docker Image to DockerHub
uses: docker/[email protected]
with:
push: true
context: ${{ github.workspace }}
tags: ${{ secrets.DOCKERHUB_USER }}/${{ secrets.DOCKERHUB_REPOSITORY }}:latest,${{ secrets.DOCKERHUB_USER }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${{ inputs.environment }}