Repository navigation
196 lines (170 loc) · 6.27 KB
/
Copy pathnextcloud-development.yml
File metadata and controls
196 lines (170 loc) · 6.27 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Validate and publish Nextcloud master image
on:
pull_request:
branches:
- main
paths:
- '.docker/app/**'
- 'tests/app/**'
- 'scripts/scan-images.sh'
- 'trivy.yaml'
- '.github/workflows/nextcloud-development.yml'
- 'scripts/resolve-nextcloud-upstream.sh'
- 'scripts/push-master-architecture.sh'
- 'scripts/publish-master-manifest.sh'
- 'tests/development/**'
push:
branches:
- main
paths:
- '.docker/app/**'
- 'tests/app/**'
- 'scripts/scan-images.sh'
- 'trivy.yaml'
- '.github/workflows/nextcloud-development.yml'
- 'scripts/resolve-nextcloud-upstream.sh'
- 'scripts/push-master-architecture.sh'
- 'scripts/publish-master-manifest.sh'
- 'tests/development/**'
schedule:
- cron: '17 3 * * *'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: nextcloud-master-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
env:
APP_IMAGE: ghcr.io/librecodecoop/nextcloud-docker-app
NEXTCLOUD_DAILY_URL: https://download.nextcloud.com/server/daily/latest-master.tar.bz2
NEXTCLOUD_BASE_TAG: stable-fpm
jobs:
script-tests:
name: Test development image scripts
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Bats
uses: bats-core/bats-action@77d6fb60505b4d0d1d73e48bd035b55074bbfb43 # 4.0.0
with:
support-install: false
assert-install: false
detik-install: false
file-install: false
- name: Test development image scripts
run: make test-development-image-scripts
validate:
needs:
- script-tests
name: master-fpm / linux/${{ matrix.arch }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Setup Bats
uses: bats-core/bats-action@77d6fb60505b4d0d1d73e48bd035b55074bbfb43 # 4.0.0
with:
support-install: false
assert-install: false
detik-install: false
file-install: false
- name: Resolve upstream inputs
id: upstream
shell: bash
run: bash scripts/resolve-nextcloud-upstream.sh "${NEXTCLOUD_BASE_TAG}" "${NEXTCLOUD_DAILY_URL}" >> "${GITHUB_OUTPUT}"
- name: Build Nextcloud master app image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .docker/app
platforms: linux/${{ matrix.arch }}
load: true
build-args: |
NEXTCLOUD_BASE_IMAGE=${{ steps.upstream.outputs.base_image }}
NEXTCLOUD_SOURCE=daily
NEXTCLOUD_DAILY_URL=${{ env.NEXTCLOUD_DAILY_URL }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.upstream.outputs.created }}
org.opencontainers.image.version=master-fpm
coop.librecode.nextcloud.channel=master
coop.librecode.nextcloud.source=${{ env.NEXTCLOUD_DAILY_URL }}
coop.librecode.nextcloud.source.sha512=${{ steps.upstream.outputs.source_sha512 }}
coop.librecode.nextcloud.base.digest=${{ steps.upstream.outputs.base_digest }}
coop.librecode.runtime.variant=fpm
tags: scan/master:${{ matrix.arch }}
cache-from: type=gha,scope=master-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=master-${{ matrix.arch }}
- name: Install Trivy
uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
with:
# renovate: datasource=github-releases depName=aquasecurity/trivy
version: v0.75.0
cache: true
- name: Scan Nextcloud master app image
shell: bash
env:
ARCH: ${{ matrix.arch }}
run: |
bash scripts/scan-images.sh "app@linux/${ARCH}=scan/master:${ARCH}"
- name: Runtime acceptance
shell: bash
env:
APP_IMAGE: scan/master:${{ matrix.arch }}
run: make test-app-image
- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push validated architecture image
if: github.event_name != 'pull_request'
shell: bash
run: bash scripts/push-master-architecture.sh "${APP_IMAGE}" "scan/master:${{ matrix.arch }}" "${GITHUB_SHA}" "${{ matrix.arch }}"
publish:
name: Publish master-fpm manifest
if: github.event_name != 'pull_request'
needs:
- validate
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Log in to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish multi-platform master-fpm
shell: bash
run: bash scripts/publish-master-manifest.sh "${APP_IMAGE}" "${GITHUB_SHA}"