forked from nextcloud/server
-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (115 loc) · 3.98 KB
/
easycloud-build.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
name: EasyCloud Build
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2024 STRATO AG
# SPDX-License-Identifier: AGPL-3.0-or-later
# The EasyCloud source is packaged as a container image.
# This is a workaround because releases can not be created without tags
# and we want to be able to create snapshots from branches.
on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'custom-npms/**'
- 'apps/**'
- 'apps/**/appinfo/info.xml'
- 'apps-custom/**'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'
push:
branches:
- main
- master
- stable*
- ionos-dev
- ionos-dev30
env:
TARGET_PACKAGE_NAME: easy-storage.zip
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
jobs:
easycloud-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
name: easycloud-build
steps:
- name: Checkout server
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
with:
submodules: true
- name: Set up node with version from package.json's engines
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: "package.json"
- name: Build Nextcloud
run: make -f IONOS/Makefile build_nextcloud FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
- name: Install dependencies & build simplesettings app
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: make -f IONOS/Makefile build_dep_simplesettings_app
- name: Install dependencies & build viewer app
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: make -f IONOS/Makefile build_dep_viewer_app
- name: Install dependencies & build user_oidc app
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: make -f IONOS/Makefile build_dep_user_oidc_app
- name: Build Custom CSS
run: make -f IONOS/Makefile build_dep_theming_app
- name: Install dependencies & build IONOS theme custom elements
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: make -f IONOS/Makefile build_dep_ionos_theme
- name: Add config partials
run: make -f IONOS/Makefile add_config_partials
- name: Zip dependencies
run: make -f IONOS/Makefile zip_dependencies TARGET_PACKAGE_NAME=${{ env.TARGET_PACKAGE_NAME }}
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
- name: Create Dockerfile
run: |
cat >Dockerfile << EOF
FROM busybox as builder
COPY ./${{ env.TARGET_PACKAGE_NAME }} /
WORKDIR /builder
RUN unzip /${{ env.TARGET_PACKAGE_NAME }} -d /builder
FROM scratch
WORKDIR /app
VOLUME /app
COPY --from=builder /builder /app
EOF
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Show changes on failure
if: failure()
run: |
git status
git --no-pager diff
exit 1 # make it red to grab attention