Skip to content

Commit 99436dc

Browse files
committed
Updated workflow and added TAG releases
1 parent 320ffe4 commit 99436dc

File tree

6 files changed

+68
-6
lines changed

6 files changed

+68
-6
lines changed

.env.sample

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
############################
2+
###> docker configuration ###
3+
4+
DOCKER_TAG=latest
5+
6+
###< docker configuration ###
7+
############################
8+
19
############################
210
###> nginx configuration ###
311

.github/workflows/docker-build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@v3
1515
- name: Docker build cache
16-
uses: satackey/action-docker-layer-caching@v0.0.8
16+
uses: satackey/action-docker-layer-caching@v0.0.11
1717
continue-on-error: true
18+
with:
19+
key: symfony-dev-docker-cache-{hash}
20+
restore-keys: symfony-dev-docker-cache-
1821
- name: Copy .env.sample to .env
1922
run: cp .env.sample .env
2023
- name: For php8.1

.github/workflows/docker-publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ jobs:
1515
- name: Checkout repository
1616
uses: actions/checkout@v3
1717
- name: Docker build cache
18-
uses: satackey/action-docker-layer-caching@v0.0.8
18+
uses: satackey/action-docker-layer-caching@v0.0.11
1919
continue-on-error: true
20+
with:
21+
key: symfony-dev-docker-cache-{hash}
22+
restore-keys: symfony-dev-docker-cache-
2023
- name: Docker Login
2124
env:
2225
DOCKER_USER: ${{secrets.DOCKER_USER}}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Docker Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
- name: Set env
17+
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
18+
- name: Docker build cache
19+
uses: satackey/action-docker-layer-caching@v0.0.11
20+
continue-on-error: true
21+
with:
22+
key: symfony-dev-docker-cache-{hash}
23+
restore-keys: symfony-dev-docker-cache-
24+
- name: Docker Login
25+
env:
26+
DOCKER_USER: ${{secrets.DOCKER_USER}}
27+
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
28+
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
29+
- name: Copy .env.sample to .env
30+
run: cp .env.sample .env
31+
- name: For php8.1
32+
run: PHP_VERSION=8.1 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=8.1 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
33+
- name: For php8.0
34+
run: PHP_VERSION=8.0 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=8.0 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
35+
- name: For php7.4
36+
run: PHP_VERSION=7.4 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.4 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
37+
- name: For php7.3
38+
run: PHP_VERSION=7.3 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.3 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
39+
- name: For php7.2
40+
run: PHP_VERSION=7.2 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.2 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
41+
- name: For php7.1
42+
run: PHP_VERSION=7.1 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.1 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
43+
- name: For php7.0
44+
run: PHP_VERSION=7.0 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.0 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
45+
- name: For php5.6
46+
run: PHP_VERSION=5.6 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=5.6 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push
47+
- name: For php5.5
48+
run: PHP_VERSION=5.5 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml build && PHP_VERSION=5.5 DOCKER_TAG=$RELEASE_VERSION docker-compose -f docker-compose-publish.yml push

docker-compose-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
99
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
1010
PHP_ENABLE_MONGODB: ${PHP_ENABLE_MONGODB}
11-
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-fpm:latest
11+
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-fpm:${DOCKER_TAG}
1212

1313
cli:
1414
build:
@@ -18,4 +18,4 @@ services:
1818
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
1919
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
2020
PHP_ENABLE_MONGODB: ${PHP_ENABLE_MONGODB}
21-
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-cli:latest
21+
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-cli:${DOCKER_TAG}

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
# PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
99
# PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
1010
# PHP_ENABLE_MONGODB: ${PHP_ENABLE_MONGODB}
11-
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-fpm:latest
11+
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-fpm:${DOCKER_TAG}
1212
environment:
1313
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
1414
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
@@ -30,7 +30,7 @@ services:
3030
# PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
3131
# PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
3232
# PHP_ENABLE_MONGODB: ${PHP_ENABLE_MONGODB}
33-
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-cli:latest
33+
image: readymadehost/symfony-dev-docker-php${PHP_VERSION}-cli:${DOCKER_TAG}
3434
environment:
3535
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
3636
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}

0 commit comments

Comments
 (0)