-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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: | ||
|
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
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/ |