Skip to content

Commit

Permalink
angular
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrong committed Jul 9, 2024
1 parent cbe41d5 commit c8a628d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 18 deletions.
44 changes: 32 additions & 12 deletions .github/workflows/angular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Build Angular Images

on:
workflow_dispatch:
inputs:
is_test:
description: "Test run"
required: true
type: boolean
default: false

jobs:
Build:
Expand All @@ -14,26 +20,40 @@ jobs:
ALIYUN_PASSWORD: ${{ secrets.ALIYUN_PASSWORD }}
steps:
- uses: actions/checkout@v3
- name: Login to docker.io
uses: docker/login-action@v2
with:
registry: docker.io
username: docworld
password: ${{ secrets.DOCKER_TOKEN }}
- name: Get tag version
uses: ikrong/actions-util@v1.0.0
- uses: ./.github/actions/login
- name: Run Tools
run: |
NODE_PATH=$(npm root --quiet -g) node ./tools/prepare.js repo-revision angular/angular
NODE_PATH=$(npm root --quiet -g) node ./tools/prepare.js repo-release-tag angular/angular
- if: ${{ !inputs.is_test }}
name: Build angular doc
uses: docker/build-push-action@v4.0.0
with:
function: fetch
params: '["https://api.github.com/repos/angular/angular/releases/latest","get",["tag_name"]]'
- name: Build angular doc
platforms: linux/amd64,linux/arm64
context: ./angular/
push: true
build-args: |
tagName=${{env.tag_name}}
DOCWORLD_SOURCE=${{ env.DOCWORLD_SOURCE }}
tags: |
docworld/angular:latest
docworld/angular:${{ env.tag_name }}
registry.cn-beijing.aliyuncs.com/docworld/angular:latest
registry.cn-beijing.aliyuncs.com/docworld/angular:${{ env.tag_name }}
- if: ${{ inputs.is_test }}
name: Test Build angular doc
uses: docker/[email protected]
with:
platforms: linux/amd64,linux/arm64
context: ./angular/
push: true
build-args: |
tagName=${{env.tag_name}}
tags: docworld/angular:latest, docworld/angular:${{ env.tag_name }}
DOCWORLD_SOURCE=${{ env.DOCWORLD_SOURCE }}
tags: |
registry.cn-beijing.aliyuncs.com/ikrong/docworld:angular
UpdateDockerDescription:
if: ${{ !inputs.is_test }}
needs: [Build]
uses: ikrong/documents/.github/workflows/_updateDocker.yml@main
with:
Expand Down
19 changes: 13 additions & 6 deletions angular/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
FROM bitnami/git:2 AS GIT
FROM bitnami/git:2 AS git
ARG tagName=main

WORKDIR /app

RUN git clone --depth 1 --single-branch -b $tagName https://github.com/angular/angular source

FROM node:16 AS NODE
FROM node:16 AS node

WORKDIR /app

COPY --from=GIT /app/source /app/source/
COPY . /app
COPY --from=git /app/source /app/source/

RUN cd /app/source/ && \
yarn install --frozen-lockfile --non-interactive && \
RUN <<EOF
cd /app/source/
yarn install --frozen-lockfile --non-interactive
yarn bazel build //aio:build --config=release --verbose_failures
/app/tools/install.sh
NODE_PATH=$(npm root --quiet -g) node /app/tools/index.js /app/source/dist/bin/adev/build/browser
EOF

FROM ikrong/mini-http:latest
ARG DOCWORLD_SOURCE

LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/ikrong/documents"
LABEL org.docworld.source="$DOCWORLD_SOURCE"

COPY --from=NODE /app/source/dist/bin/aio/build /www/
COPY --from=node /app/source/dist/bin/adev/build/browser /www/

0 comments on commit c8a628d

Please sign in to comment.