-
-
Notifications
You must be signed in to change notification settings - Fork 16
105 lines (90 loc) · 2.6 KB
/
test.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Test generated image
on:
push:
branches:
- "6.1.x"
pull_request:
branches:
- "6.1.x"
jobs:
meta:
runs-on: ubuntu-latest
outputs:
SHA: ${{ steps.vars.outputs.SHA }}
PLONE_VERSION: ${{ steps.vars.outputs.PLONE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compute SHA value to be used in building the main image
id: vars
run: |
echo "SHA=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "PLONE_VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
environment: DOCKER_HUB
needs:
- meta
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Builder Image
id: meta-builder
uses: docker/metadata-action@v5
with:
images: |
plone/server-builder
tags: |
type=sha
- name: Prod Config Image
id: meta-prod-config
uses: docker/metadata-action@v5
with:
images: |
plone/server-prod-config
tags: |
type=sha
- name: Main Image
id: meta-main
uses: docker/metadata-action@v5
with:
images: |
plone/plone-backend
tags: |
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build builder image for testing
uses: docker/build-push-action@v4
with:
context: ./
file: Dockerfile.builder
tags: ${{ steps.meta-builder.outputs.tags }}
push: true
build-args: |
PLONE_VERSION=${{ needs.meta.outputs.PLONE_VERSION }}
- name: Build prod-config image for testing
uses: docker/build-push-action@v4
with:
context: ./
file: Dockerfile.prod
tags: ${{ steps.meta-prod-config.outputs.tags }}
push: true
- name: Build main image for testing
uses: docker/build-push-action@v4
with:
context: ./
file: Dockerfile
tags: ${{ steps.meta-main.outputs.tags }}
push: true
build-args: |
PLONE_VERSION=${{ needs.meta.outputs.SHA }}
- name: Test
run: |
docker pull ${{ steps.meta-main.outputs.tags }}
./test/run.sh ${{ steps.meta-main.outputs.tags }}