-
Notifications
You must be signed in to change notification settings - Fork 27
47 lines (41 loc) · 1.34 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build image to DockerHub
on:
push:
branches: [main]
paths:
- "apps/*/Dockerfile"
- "apps/*/cmd.sh"
- "apps/*/entrypoint.sh"
jobs:
test:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get applist
id: getlist
run: |
git diff --name-only HEAD^ HEAD
changed_files=$(git diff --name-only HEAD^ HEAD)
app_list=$(echo "$changed_files" | grep -E 'apps/.*/(Dockerfile|cmd.sh|entrypoint.sh)$' | awk -F'/' '{print $2}' | sort | uniq)
echo "APP_LISTS=$app_list" >> $GITHUB_ENV
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push Docker image
if: env.PASS_STEP=='false'
with:
image: websoft9dev/${{env.W9_NAME}}
tags: ${{env.TAGS}}
registry: docker.io
dockerfile: Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: websoft9dev/${{env.W9_NAME}}
readme-filepath: apps/${{env.W9_NAME}}/myread.md