forked from Ylianst/MeshCentral
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (136 loc) · 4.5 KB
/
Copy pathdocker-alpine.yml
File metadata and controls
139 lines (136 loc) · 4.5 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Docker-Builder-Alpine
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Daily at 00:00 UTC
release:
types: [ published ]
permissions:
contents: read
packages: write
actions: write
jobs:
prepare:
runs-on: ubuntu-latest
name: Run Translations
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "24.x"
- name: Run translate.js (ignore errors)
run: node translate.js || true
working-directory: translate
- name: Run translate extractall
run: node translate extractall
working-directory: translate
- name: Run translate.js minifyall
run: node translate.js minifyall
working-directory: translate
- name: Run translate.js translateall
run: node translate.js translateall
working-directory: translate
- name: Upload repo with translations
uses: actions/upload-artifact@v5
with:
name: repo-with-preparations
path: ./
build-images:
runs-on: ubuntu-latest
needs: prepare
strategy:
fail-fast: false
max-parallel: 5
matrix:
include:
- variant: mongodb
suffix: -mongodb
postgresql: false
mongodb: true
mariadb: false
- variant: postgresql
suffix: -postgresql
postgresql: true
mongodb: false
mariadb: false
- variant: mariadb
suffix: -mariadb
postgresql: false
mongodb: false
mariadb: true
- variant: complete
suffix:
postgresql: true
mongodb: true
mariadb: true
- variant: slim
suffix: -slim
postgresql: false
mongodb: false
mariadb: false
name: Build Docker Image (${{ matrix.variant }})
steps:
- name: Download repo artifact
uses: actions/download-artifact@v5
with:
name: repo-with-preparations
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
cache-image: false
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
cache-binary: false
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: compile metadata information
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/meshcentral
docker.io/${{ secrets.DOCKER_USERNAME }}/meshcentral
tags: |
type=ref,event=branch,suffix=${{ matrix.suffix }}
type=ref,event=tag,suffix=${{ matrix.suffix }}
type=raw,value=latest,enable=${{startsWith(github.ref, 'refs/tags/') && matrix.variant != 'complete'}},suffix=${{ matrix.suffix }}
type=raw,value=latest,enable=${{startsWith(github.ref, 'refs/tags/') && matrix.variant == 'complete'}}
- name: Build and push Docker image (${{ matrix.variant }}
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
context: .
file: ./docker/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
build-args: |
DISABLE_MINIFY=yes
DISABLE_TRANSLATE=yes
DISABLE_EXTRACT=yes
INCLUDE_MONGODB_TOOLS=${{ matrix.mongodb }}
INCLUDE_POSTGRESQL_TOOLS=${{ matrix.postgresql }}
INCLUDE_MARIADB_TOOLS=${{ matrix.mariadb }}
rerun-on-failure:
needs: build-images
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yaml -r ${{ github.head_ref || github.ref_name }} -F run_id=${{ github.run_id }}