mirror of
https://github.com/suitenumerique/docs.git
synced 2026-04-26 01:25:05 +02:00
Compare commits
1 Commits
renovate/p
...
feature/ov
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1b41cc4c4 |
11
.github/workflows/docker-hub.yml
vendored
11
.github/workflows/docker-hub.yml
vendored
@@ -59,6 +59,14 @@ jobs:
|
||||
-
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout custom code repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'AntoLC/docs-customized'
|
||||
ref: 'main'
|
||||
path: docs-custom
|
||||
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
@@ -76,7 +84,7 @@ jobs:
|
||||
name: Run trivy scan
|
||||
uses: numerique-gouv/action-trivy-cache@main
|
||||
with:
|
||||
docker-build-args: '-f src/frontend/Dockerfile --target frontend-production'
|
||||
docker-build-args: '-f src/frontend/Dockerfile --target frontend-production --build-arg CUSTOM_CODE=docs-custom'
|
||||
docker-image-name: 'docker.io/lasuite/impress-frontend:${{ github.sha }}'
|
||||
-
|
||||
name: Build and push
|
||||
@@ -87,6 +95,7 @@ jobs:
|
||||
target: frontend-production
|
||||
build-args: |
|
||||
DOCKER_USER=${{ env.DOCKER_USER }}:-1000
|
||||
CUSTOM_CODE=docs-custom
|
||||
PUBLISH_AS_MIT=false
|
||||
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
@@ -47,6 +47,15 @@ ENV NEXT_PUBLIC_SW_DEACTIVATED=${SW_DEACTIVATED}
|
||||
ARG PUBLISH_AS_MIT
|
||||
ENV NEXT_PUBLIC_PUBLISH_AS_MIT=${PUBLISH_AS_MIT}
|
||||
|
||||
ARG CUSTOM_CODE
|
||||
COPY ./${CUSTOM_CODE} /tmp/custom_code
|
||||
RUN if [ -n "$CUSTOM_CODE" ] && [ -d "/tmp/custom_code" ] && [ "$(ls -A /tmp/custom_code)" ]; then \
|
||||
echo "Custom code provided. Replacing files from $CUSTOM_CODE..."; \
|
||||
cp -Rv /tmp/custom_code/${CUSTOM_CODE}/* .; \
|
||||
else \
|
||||
echo "No custom code provided. Skipping replacement..."; \
|
||||
fi
|
||||
|
||||
RUN yarn build
|
||||
|
||||
# ---- Front-end image ----
|
||||
|
||||
Reference in New Issue
Block a user