IONOS: workflow: run composer install for user_oidc #73
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: EasyCloud Build | |
# 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/**' | |
- 'apps/**/appinfo/info.xml' | |
- 'package.json' | |
- 'package-lock.json' | |
- 'tsconfig.json' | |
- '**.js' | |
- '**.ts' | |
- '**.vue' | |
push: | |
branches: | |
- main | |
- master | |
- stable* | |
- ionos-dev | |
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@v3 | |
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: Install dependencies & build simplesettings app | |
env: | |
CYPRESS_INSTALL_BINARY: 0 | |
PUPPETEER_SKIP_DOWNLOAD: true | |
run: | | |
cd apps-custom/simplesettings | |
npm ci | |
npm run build | |
cd ../.. | |
- name: Install dependencies & build user_oidc app | |
env: | |
CYPRESS_INSTALL_BINARY: 0 | |
PUPPETEER_SKIP_DOWNLOAD: true | |
run: | | |
cd apps-external/user_oidc | |
composer install --no-dev -o | |
npm ci | |
npm run build | |
cd ../.. | |
- name: Add config partials | |
run: | | |
cp IONOS/configs/*.config.php config/ | |
- name: Zip dependencies | |
run: | | |
buildDate=$(date +%s) | |
buildRef=${{ github.sha }} | |
jq -n --arg buildDate "$buildDate" --arg buildRef "$buildRef" '{buildDate: $buildDate, buildRef: $buildRef}' > version.json | |
echo "version.json created" | |
jq . version.json | |
echo "zip relevant files to ${{ env.TARGET_PACKAGE_NAME }}" | |
zip -r "${{ env.TARGET_PACKAGE_NAME }}" \ | |
IONOS/ \ | |
3rdparty/ \ | |
apps/ \ | |
apps-custom/ \ | |
apps-external/ \ | |
config/ \ | |
core/ \ | |
dist/ \ | |
lib/ \ | |
ocs/ \ | |
ocs-provider/ \ | |
resources/ \ | |
themes/ \ | |
AUTHORS \ | |
composer.json \ | |
composer.lock \ | |
console.php \ | |
COPYING \ | |
cron.php \ | |
index.html \ | |
index.php \ | |
occ \ | |
package.json \ | |
package-lock.json \ | |
public.php \ | |
remote.php \ | |
robots.txt \ | |
status.php \ | |
version.php \ | |
version.json \ | |
-x "apps/theming/img/background/**" \ | |
-x "apps/*/tests/**" \ | |
-x "apps-*/*/.git" \ | |
-x "apps-*/*/.github" \ | |
-x "apps-*/*/src**" \ | |
-x "apps-*/*/node_modules**" \ | |
-x "apps-*/*/tests**" \ | |
-x "**/cypress/**" \ | |
-x "*.git*" \ | |
-x "*.editorconfig*" | |
- 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 |