This commit is contained in:
@@ -2,14 +2,48 @@ name: "Build image"
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
env: {}
|
env: {}
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-frontend:
|
||||||
name: Build
|
name: Build base frontend image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
UI_HASH: ${{ steps.git-parse.outputs.PULP_UI_COMMIT }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
- name: Fetch commit hash for Pulp UI repository
|
||||||
|
id: git-parse
|
||||||
|
run: |
|
||||||
|
echo "PULP_UI_COMMIT=$(git -C vendor/pulp-ui rev-parse HEAD)" >> $GITEA_OUTPUT
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Log in to built-in registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ gitea.server_url }}
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ gitea.server_url }}/${{ gitea.repository }}
|
||||||
|
tags: |
|
||||||
|
type=sha,format=short
|
||||||
|
type=semver,pattern=${{ steps.git-parse.outputs.PULP_UI_COMMIT }}
|
||||||
|
- name: Build frontend image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: vendor/pulp-ui
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
# TODO: add build nginx image
|
||||||
|
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
FROM node:24-alpine AS builder
|
||||||
|
|
||||||
|
ARG PULP_UI_COMMIT
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
RUN apk add --no-cache git && git config --global --add safe.directory /app
|
||||||
|
|
||||||
|
COPY package-lock.json /app/
|
||||||
|
RUN --mount=type=bind,source=package.json,target=./package.json \
|
||||||
|
--mount=type=cache,target=/root/.npm \
|
||||||
|
npm install --legacy-peer-deps --include=dev
|
||||||
|
|
||||||
|
COPY ./ /app
|
||||||
|
|
||||||
|
ENV PATH=/app/node_modules/.bin:$PATH PULP_UI_COMMIT=$PULP_UI_COMMIT
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
WORKDIR /www-root
|
||||||
|
COPY --from=builder /app/dist /www-root
|
||||||
|
|
||||||
Reference in New Issue
Block a user