-
-
Notifications
You must be signed in to change notification settings - Fork 69
82 lines (72 loc) · 2.14 KB
/
main.yml
File metadata and controls
82 lines (72 loc) · 2.14 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
name: Docker
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
deployment:
workflow_dispatch:
env:
DB_DATABASE: liberu
DB_USERNAME: liberu
DB_PASSWORD: secret
jobs:
docker:
if: github.event_name == 'push'
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: liberu
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
<<<<<<< HEAD
- name: Checkout code
=======
- name: Checkout
>>>>>>> 327e4771520e20cf0d5d971ae3b2a73a7baec282
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e4288.5
with:
images: liberu/genealogy
flavor: |
latest=true
<<<<<<< HEAD
=======
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
>>>>>>> 327e4771520e20cf0d5d971ae3b2a73a7baec282
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198.562a7d2c83
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=liberu/control-panel:buildcache
cache-to: type=registry,ref=liberu/control-panel:buildcache,mode=max