Skip to content

Commit d05aff5

Browse files
author
Kevin Buchholz
authored
Merge pull request #63 from sourceboat/feature/59_automated_image_builds_via_github_Actions
2 parents aa1d566 + 92be6af commit d05aff5

File tree

5 files changed

+101
-2
lines changed

5 files changed

+101
-2
lines changed

.github/workflows/edgeImageBuild.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build edge image
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
-
16+
name: Set up QEMU
17+
uses: docker/setup-qemu-action@v1
18+
-
19+
name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v1
21+
-
22+
name: Login to DockerHub
23+
uses: docker/login-action@v1
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
-
28+
name: Build and push
29+
uses: docker/build-push-action@v2
30+
with:
31+
context: .
32+
platforms: linux/amd64,linux/arm64
33+
push: true
34+
tags: |
35+
sourceboat/docker-laravel:edge
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build stable image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
-
16+
name: Docker meta
17+
id: meta
18+
uses: docker/metadata-action@v3
19+
with:
20+
# list of Docker images to use as base name for tags
21+
images: |
22+
sourceboat/docker-laravel
23+
flavour: |
24+
latest=true
25+
# generate Docker tags based on the following events/attributes
26+
tags: |
27+
type=semver,pattern={{version}}
28+
type=semver,pattern={{major}}.{{minor}}
29+
type=semver,pattern={{major}}
30+
-
31+
name: Set up QEMU
32+
uses: docker/setup-qemu-action@v1
33+
-
34+
name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v1
36+
-
37+
name: Login to DockerHub
38+
uses: docker/login-action@v1
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
-
43+
name: Build and push
44+
uses: docker/build-push-action@v2
45+
with:
46+
context: .
47+
platforms: linux/amd64,linux/arm64
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/testImageBuild.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Build test image
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
docker:
7+
runs-on: ubuntu-latest
8+
steps:
9+
-
10+
name: Checkout
11+
uses: actions/checkout@v2
12+
-
13+
name: Run tests
14+
run: docker-compose -f docker-compose.test.yml run test

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ COPY ./etc/service/ /etc/service/
7878
RUN find /etc/service/ -name "run" -exec chmod -v +x {} \;
7979

8080
# copy nginx config files
81-
COPY ./etc/nginx/ /etc/nginx/
81+
COPY ./etc/nginx/conf.d/ /etc/nginx/conf.d/
82+
COPY ./etc/nginx/nginx.conf /etc/nginx/nginx.conf
8283

8384
# copy php config files
8485
COPY ./usr/local/etc/php/ /usr/local/etc/php/

docker-compose.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '3.7'
22
services:
3-
sut:
3+
test:
44
build: .
55
command: /root/test/test-command.sh
66
environment:

0 commit comments

Comments
 (0)