Skip to content

Commit 6981651

Browse files
authored
Merge pull request #1 from kool-dev/ci
add CI for building and pushing images
2 parents 961577e + 528e3af commit 6981651

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
9+
- package-ecosystem: "docker"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"

.github/workflows/ci-cd.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI/CD
2+
3+
on: [push, workflow_dispatch]
4+
5+
env:
6+
DOCKER_BUILDKIT: 1
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Build
18+
run: |
19+
docker build --pull -t kooldev/php:7.4-nginx-oci8 7.4-nginx-oci8
20+
docker build --pull -t kooldev/php:7.4-nginx-oci8-prod 7.4-nginx-oci8-prod
21+
22+
- name: Tests
23+
run: |
24+
docker run kooldev/php:7.4-nginx-oci8 php -r "extension_loaded('oci8') or die(1);"
25+
docker run kooldev/php:7.4-nginx-oci8-prod php -r "extension_loaded('oci8') or die(1);"
26+
27+
- name: Login to DockerHub
28+
uses: docker/login-action@v1
29+
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-oci8'
30+
with:
31+
username: ${{ secrets.DOCKER_USERNAME }}
32+
password: ${{ secrets.DOCKER_PASSWORD }}
33+
34+
- name: Push to DockerHub
35+
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-oci8'
36+
run: |
37+
docker push kooldev/php:7.4-nginx-oci8
38+
docker push kooldev/php:7.4-nginx-oci8-prod

0 commit comments

Comments
 (0)