diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 403b238..30d5d57 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,29 +34,6 @@ jobs: - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(npx yarn cache dir)" >> ${GITHUB_OUTPUT} - - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Execute yarn - if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: npx yarn --frozen-lockfile --network-timeout 180000 - - - name: Run Build - run: npx yarn build - - name: Login to ghcr.io uses: docker/login-action@v2 with: diff --git a/Dockerfile b/Dockerfile index 566b430..470f772 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,15 @@ # # SPDX-License-Identifier: Apache-2.0 +FROM registry.access.redhat.com/ubi9/nodejs-18:latest AS builder + +COPY . . + +RUN npm install -g yarn \ + && npx yarn install \ + && npx yarn build + + FROM scratch LABEL org.opencontainers.image.title="Red Hat OpenShift Local" \ @@ -22,8 +31,8 @@ LABEL org.opencontainers.image.title="Red Hat OpenShift Local" \ org.opencontainers.image.vendor="redhat" \ io.podman-desktop.api.version=">= 0.16.0" -COPY package.json /extension/ -COPY LICENSE /extension/ -COPY README.md /extension/ -COPY icon.png /extension/ -COPY dist /extension/dist +COPY --from=builder /opt/app-root/src/package.json /extension/ +COPY --from=builder /opt/app-root/src/LICENSE /extension/ +COPY --from=builder /opt/app-root/src/README.md /extension/ +COPY --from=builder /opt/app-root/src/icon.png /extension/ +COPY --from=builder /opt/app-root/src/dist /extension/dist