Skip to content

Commit e0b5b1b

Browse files
committed
Updated Github Action
1 parent 197cc7a commit e0b5b1b

File tree

1 file changed

+64
-20
lines changed

1 file changed

+64
-20
lines changed

.github/workflows/push-to-dockerhub.yml

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,45 @@ on:
44
release:
55
types: [published]
66

7+
env:
8+
REGISTRY: docker.io
9+
IMAGE_NAME: espocrm/espocrm
10+
711
jobs:
812
dockerhub:
913
runs-on: ubuntu-latest
14+
1015
steps:
11-
-
12-
name: Checkout
16+
- name: Checkout
1317
uses: actions/checkout@v3
14-
-
15-
name: Set up QEMU
16-
uses: docker/setup-qemu-action@v2
17-
-
18-
name: Set up Docker Buildx
19-
uses: docker/setup-buildx-action@v2
20-
-
21-
name: Login to DockerHub
22-
uses: docker/login-action@v2
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Authenticate to registry ${{ env.REGISTRY }}
23+
uses: docker/login-action@v3
2324
with:
25+
registry: ${{ env.REGISTRY }}
2426
username: ${{ secrets.DOCKERHUB_USERNAME }}
2527
password: ${{ secrets.DOCKERHUB_TOKEN }}
26-
-
27-
name: Get Version
28+
29+
- name: Extract Docker metadata
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34+
35+
- name: Get Version
2836
id: get_version
2937
uses: battila7/get-version-action@v2
30-
-
31-
name: apache
32-
uses: docker/build-push-action@v4
38+
39+
- name: Apache Build
40+
uses: docker/build-push-action@v6
3341
with:
3442
context: ./apache
3543
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
3644
push: true
45+
labels: ${{ steps.meta.outputs.labels }}
3746
tags: |
3847
espocrm/espocrm:latest
3948
espocrm/espocrm:${{ steps.get_version.outputs.version }}
@@ -43,27 +52,62 @@ jobs:
4352
espocrm/espocrm:${{ steps.get_version.outputs.version }}-apache
4453
espocrm/espocrm:${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }}-apache
4554
espocrm/espocrm:${{ steps.get_version.outputs.major }}-apache
46-
-
47-
name: fpm
55+
cache-from: type=gha
56+
cache-to: type=gha,mode=max
57+
58+
- name: Apache Docker Scout
59+
id: apache-scout
60+
uses: docker/scout-action@v1
61+
with:
62+
command: cves
63+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:apache
64+
ignore-unchanged: true
65+
only-severities: critical,high
66+
67+
- name: FPM Build
4868
uses: docker/build-push-action@v4
4969
with:
5070
context: ./fpm
5171
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
5272
push: true
73+
labels: ${{ steps.meta.outputs.labels }}
5374
tags: |
5475
espocrm/espocrm:fpm
5576
espocrm/espocrm:${{ steps.get_version.outputs.version }}-fpm
5677
espocrm/espocrm:${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }}-fpm
5778
espocrm/espocrm:${{ steps.get_version.outputs.major }}-fpm
58-
-
59-
name: fpm-alpine
79+
cache-from: type=gha
80+
cache-to: type=gha,mode=max
81+
82+
- name: FPM Docker Scout
83+
id: fpm-scout
84+
uses: docker/scout-action@v1
85+
with:
86+
command: cves
87+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:fpm
88+
ignore-unchanged: true
89+
only-severities: critical,high
90+
91+
- name: FPM-Alpine Build
6092
uses: docker/build-push-action@v4
6193
with:
6294
context: ./fpm-alpine
6395
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
6496
push: true
97+
labels: ${{ steps.meta.outputs.labels }}
6598
tags: |
6699
espocrm/espocrm:fpm-alpine
67100
espocrm/espocrm:${{ steps.get_version.outputs.version }}-fpm-alpine
68101
espocrm/espocrm:${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }}-fpm-alpine
69102
espocrm/espocrm:${{ steps.get_version.outputs.major }}-fpm-alpine
103+
cache-from: type=gha
104+
cache-to: type=gha,mode=max
105+
106+
- name: FPM Alpine Docker Scout
107+
id: fpm-alpine-scout
108+
uses: docker/scout-action@v1
109+
with:
110+
command: cves
111+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:fpm-alpine
112+
ignore-unchanged: true
113+
only-severities: critical,high

0 commit comments

Comments
 (0)