This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
149 lines (145 loc) · 4.77 KB
/
pull-request.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
name: Pull request
on:
pull_request:
branches-ignore: [master, main]
push:
branches-ignore: [master, main]
concurrency:
group: ${{ github.ref }}.pr
cancel-in-progress: true
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
DOCKER_DEFAULT_PLATFORM: linux/amd64
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: everlytic/[email protected]
if: contains(github.ref, 'dependabot') == false
with:
github_token: ${{ github.token }}
source_ref: 'master'
target_branch: ${{ github.ref }}
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}'
- name: Set Environment Variables
uses: ./.github/actions/setvars
with:
varFilePath: ./.github/variables/vars.env
- name: Setup buildx
uses: docker/setup-buildx-action@v2
- name: Setup build cache
uses: jpribyl/[email protected]
continue-on-error: true
with:
key: image-build-${{ env.TAG }}-{hash}
restore-keys: |
image-build-${{ env.TAG }}-
- name: Build image
run: ./hooks/build
- name: env.TAG? Log in to Container registry
if: ${{ fromJSON(env.PUSH_ON_PR) }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: itsthejb
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: env.TAG? Tag image
if: ${{ fromJSON(env.PUSH_ON_PR) }}
run: docker tag itsthejb/ispconfig:latest itsthejb/ispconfig:${{ env.TAG }}
- name: env.TAG? Push image
if: ${{ fromJSON(env.PUSH_ON_PR) }}
run: docker push itsthejb/ispconfig:${{ env.TAG }}
- name: Run Snyk check
if: ${{ github.event_name == 'pull_request' }}
continue-on-error: true
uses: snyk/actions/docker@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: itsthejb/ispconfig
args: --file=Dockerfile
- name: Upload Synk results
if: ${{ github.event_name == 'pull_request' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif
testBats:
name: Tests [Bats]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: everlytic/[email protected]
if: contains(github.ref, 'dependabot') == false
with:
github_token: ${{ github.token }}
source_ref: 'master'
target_branch: ${{ github.ref }}
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}'
- name: Setup buildx
uses: docker/setup-buildx-action@v2
- uses: jpribyl/[email protected]
continue-on-error: true
with:
key: image-test-bats-{hash}
restore-keys: |
image-test-bats-
- name: Prepare test
run: hooks/pre_test
- name: Run tests
run: hooks/test Bats
testPuppeteer1:
name: Tests [Puppeteer1]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: everlytic/[email protected]
if: contains(github.ref, 'dependabot') == false
with:
github_token: ${{ github.token }}
source_ref: 'master'
target_branch: ${{ github.ref }}
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}'
- name: Setup buildx
uses: docker/setup-buildx-action@v2
- uses: jpribyl/[email protected]
continue-on-error: true
with:
key: image-test-puppeteer1-{hash}
restore-keys: |
image-test-puppeteer1-
- name: Prepare test
run: hooks/pre_test
- name: Run tests
run: hooks/test Puppeteer1
testPuppeteer2:
name: Tests [Puppeteer2]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: everlytic/[email protected]
if: contains(github.ref, 'dependabot') == false
with:
github_token: ${{ github.token }}
source_ref: 'master'
target_branch: ${{ github.ref }}
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}'
- name: Setup buildx
uses: docker/setup-buildx-action@v2
- uses: jpribyl/[email protected]
continue-on-error: true
with:
key: image-test-puppeteer2-{hash}
restore-keys: |
image-test-puppeteer2-
- name: Prepare test
run: hooks/pre_test
- name: Run tests
run: hooks/test Puppeteer2