-
Notifications
You must be signed in to change notification settings - Fork 14
83 lines (77 loc) · 2.48 KB
/
docker-publish.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
name: Publish Docker image
on:
push:
# TODO: Add push type for release
# Publish `master` as Docker `latest` image.
branches:
- master
- mysql
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
# steps:
# - uses: actions/checkout@v2
# Setup mysqlserver.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
jobs:
mysql57:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Shutdown existing MySQL
run: sudo service mysql stop
push_to_registries:
#- name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up MySQL
uses: cweinberger/github-actions-mysql@main
with:
version: 5.7
hostPort: 3306
containerPort: 3306
rootPassword: root
user: TestUser
password: TestPassword
database: TestDatabase
characterSet: utf8mb4
collation: utf8mb4_general_ci
sqlMode: NO_ENGINE_SUBSTITUTION
- name: Print running docker containers
run: docker ps
- name: Check out the repo
uses: actions/checkout@v3
- name: Identify git repo path
run: ls $GITHUB_WORKSPACE && ls -l /home/runner/work/
- name: Wait for mysql
run: sleep 15
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# username: curtishall
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
# with:
# images: bluecherrydvr/bluecherry
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
#working-directory: server/
context: "{{defaultContext}}:server"
# username: curtishall
# password: ${{ secrets.DOCKER_PASSWORD }}
# file: ./server/Dockerfile
push: true
tags: bluecherrydvr/bluecherry:unstable
labels: github_ci