Skip to content

Commit 413f349

Browse files
committed
Add github workflow
1 parent 325b269 commit 413f349

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/[email protected]
16+
17+
- name: Build
18+
run: |
19+
docker build --pull -t kooldev/php:8.0-nginx-swoole 8.0-nginx-swoole
20+
docker build --pull -t kooldev/php:8.0-nginx-swoole-prod 8.0-nginx-swoole-prod
21+
22+
- name: Tests
23+
run: |
24+
docker run kooldev/php:8.0-nginx-swoole php -r "extension_loaded('swoole') or die(1);"
25+
docker run kooldev/php:8.0-nginx-swoole-prod php -r "extension_loaded('swoole') or die(1);"
26+
27+
- name: Login to DockerHub
28+
uses: docker/[email protected]
29+
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
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-swoole'
36+
run: |
37+
docker push kooldev/php:8.0-nginx-swoole
38+
docker push kooldev/php:8.0-nginx-swoole-prod

0 commit comments

Comments
 (0)