-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (80 loc) · 2.13 KB
/
backend_image.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Cria uma nova imagem de backend
on:
workflow_call:
secrets:
registry-username:
required: true
registry-password:
required: true
inputs:
image-name:
required: true
type: string
default: "Dockerfile"
context:
required: true
type: string
default: "."
dockerfile:
required: true
type: string
platforms:
required: true
type: string
load:
required: false
type: boolean
default: false
push:
required: false
type: boolean
default: false
is-latest:
required: false
type: boolean
default: false
jobs:
image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: "Metadados da Imagem Docker"
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ inputs.image-name }}
flavor:
latest=false
tags: |
type=ref,event=branch
type=sha
type=raw,value=latest,enable=${{ inputs.is-latest }}
- name: "Set up QEMU"
uses: docker/setup-qemu-action@v2
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v2
- name: "Login no ghcr.io"
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.registry-username }}
password: ${{ secrets.registry-password }}
- name: "Usa o mxdev para baixar dependências"
run: |
pip install mxdev
mxdev -c mx.ini
- name: "Gera imagem e publica no ghcr.io"
uses: docker/build-push-action@v3
with:
context: ${{ inputs.context }}
platforms: ${{ inputs.platforms }}
file: ${{ inputs.dockerfile }}
push: ${{ inputs.push && github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: ${{ inputs.load }}