Skip to content
This repository was archived by the owner on Mar 30, 2024. It is now read-only.

Commit 344e250

Browse files
committed
Replace Travis with GH-Actions
1 parent ca32588 commit 344e250

5 files changed

Lines changed: 65 additions & 25 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Docker Image Push (on commit and base image update)
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
schedule:
7+
- cron: "15 4 */3 * *"
8+
9+
env:
10+
IMAGE_OWNER: kimbtechnologies
11+
IMAGE_NAME: ttt_sync
12+
BASE_IMAGE: kimbtechnologies/php_nginx:latest
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
# Init and check
20+
21+
- name: Access to repository contents
22+
uses: actions/checkout@v3
23+
24+
- name: Check for new baseimage
25+
id: check
26+
uses: lucacome/docker-image-update-checker@v1
27+
with:
28+
base-image: "${{env.BASE_IMAGE}}"
29+
image: "${{env.IMAGE_OWNER}}/${{env.IMAGE_NAME}}:latest"
30+
if: github.event_name != 'push'
31+
32+
# Build image
33+
34+
- name: Build the Docker image
35+
run: docker build . --file "Dockerfile" --tag "$IMAGE_OWNER/$IMAGE_NAME:latest"
36+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
37+
38+
# Push latest tag
39+
40+
- name: Login to DockerHub
41+
uses: docker/login-action@v2
42+
with:
43+
username: ${{ secrets.DOCKER_USERNAME }}
44+
password: ${{ secrets.DOCKER_TOKEN }}
45+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
46+
47+
- name: Push to DockerHub
48+
run: docker push "$IMAGE_OWNER/$IMAGE_NAME:latest"
49+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
50+
51+
# Version tags to push
52+
53+
- name: Tag and push versions
54+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
55+
run: |
56+
cat VERSION | while read TAG; do
57+
if [[ $TAG =~ ^#.* ]] ; then
58+
echo "Skipping $TAG";
59+
else
60+
echo "Tagging image as $TAG and pushing";
61+
docker tag "$IMAGE_OWNER/$IMAGE_NAME:latest" "$IMAGE_OWNER/$IMAGE_NAME:$TAG"
62+
docker push "$IMAGE_OWNER/$IMAGE_NAME:$TAG"
63+
fi;
64+
done;

β€Ž.travis.ymlβ€Ž

Lines changed: 0 additions & 7 deletions
This file was deleted.

β€ŽDockerfileβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM kimbtechnologies/php_nginx:8-latest
1+
FROM kimbtechnologies/php_nginx:latest
22

33
# enable get_browser() in PHP
44
RUN mkdir /start/ \

β€ŽVERSIONβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
latest
21
0.6.1
32
0.6
43
0

β€Ždockerpublish.shβ€Ž

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
Β (0)