Skip to content

Commit 80ebc80

Browse files
committed
automate docker deploy
1 parent f39eb35 commit 80ebc80

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Docker image
2+
3+
on:
4+
release:
5+
types: [published]
6+
branches:
7+
- '7.4'
8+
9+
jobs:
10+
push_to_registry:
11+
name: Push Docker image to Docker Hub
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out the repo
15+
uses: actions/checkout@v2
16+
17+
- name: Log in to Docker Hub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USER }}
21+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
22+
23+
- name: Extract metadata (tags, labels) for Docker
24+
id: meta
25+
uses: docker/metadata-action@v3
26+
with:
27+
images: rushlowdev/php-cli
28+
29+
- name: Build and push Docker CLI image
30+
uses: docker/build-push-action@v2
31+
with:
32+
context: ./cli
33+
push: true
34+
tags: 7.4-cli
35+
labels: ${{ steps.meta.outputs.labels }}
36+
37+
- name: Build and push Docker FPM image
38+
uses: docker/build-push-action@v2
39+
with:
40+
context: ./fpm
41+
push: true
42+
tags: 7.4-fpm
43+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)