-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1 KB
/
build-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
name: ' '
on:
workflow_call:
inputs:
repo:
required: true
type: string
context_path:
required: true
type: string
image:
required: true
type: string
tag:
required: true
type: string
dockerfile_path:
required: true
type: string
secrets:
PACKAGES_TOKEN:
required: true
jobs:
build-and-push:
runs-on: ubuntu-latest
name: Build and Push Image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to GitHub Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PACKAGES_TOKEN }}
- name: Build and Push Docker Image
run: |
docker build ${{ inputs.context_path }} --tag ${{ inputs.repo }}/${{ inputs.image }}:${{ inputs.tag }} -f ${{ inputs.dockerfile_path }}
docker push ${{ inputs.repo }}/${{ inputs.image }}:${{ inputs.tag }}