Skip to content

Commit

Permalink
chore: correct Docker configuration (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Sep 7, 2023
1 parent 6648be1 commit ee7bb90
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 15 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
name: Deploy
name: deploy

on: push

jobs:
website:
if: "startsWith(github.event.commits[0].message, 'release')"
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/setup-node@v3
with:
node-version: 16.15.0

- name: checkout
uses: actions/checkout@master
uses: actions/checkout@v4

- uses: borales/[email protected]
with:
cmd: install

- name: build
# Copy dockerfile.docs & _nginx just only for ng-alain.com
run: |
yarn run site:build
cp ./src/dist/browser/index.html ./src/dist/browser/404.html
cp ./Dockerfile.docs ./src/dist/browser/Dockerfile.docs
cp -r ./_nginx/ ./src/dist/browser/_nginx
- name: deploy-to-gh-pages
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./src/dist/browser
uses: peaceiris/actions-gh-pages@v3
# env:
# # PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PUBLISH_BRANCH: gh-pages
# PUBLISH_DIR: ./src/dist/browser
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./src/dist/browser
emptyCommits: false

- name: deploy-to-surge
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/docker-build-doc-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: docker-build-doc-site

on:
push:
branches:
- master

jobs:
website:
if: "startsWith(github.event.commits[0].message, 'release')"
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/setup-node@v3
with:
node-version: 16.15.0

- name: checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login Docker
uses: docker/login-action@v2
with:
# registry: registry.gitlab.com
# username: ${{ secrets.GITLAB_USERNAME }}
# password: ${{ secrets.GITLAB_PASSWORD }}
# Docker Hub
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.docs
push: true
tags:
cipchk/ng-alain-docs:latest
# registry.gitlab.com/ng-alain/images:docs
2 changes: 1 addition & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
if: "!startsWith(github.event.commits[0].message, 'release')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: [email protected]:ng-alain/delon.git
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"[jsonc]": {
"editor.formatOnSave": false
},
"[yaml]": {
"editor.formatOnSave": false
},
"files.associations": {
"*.json": "jsonc",
".prettierrc": "json",
Expand Down
5 changes: 1 addition & 4 deletions Dockerfile.docs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
# EXPOSE 80
# CMD [ "node", "server/main.js" ]


FROM node:lts as dist
MAINTAINER authors="cipchk <[email protected]>"
WORKDIR /dist
RUN git clone --depth 1 --branch gh-pages https://github.com/ng-alain/delon.git . \
&& sed -i 's/\/delon\//\//g' /dist/index.html \
&& sed -i 's/\/delon\//\//g' /dist/404.html
RUN git clone --depth 1 --branch gh-pages https://github.com/ng-alain/delon.git .
COPY _nginx _nginx

FROM nginx:stable-alpine
Expand Down
4 changes: 3 additions & 1 deletion packages/abc/reuse-tab/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ Triggered when the current route allows reusing and leave route.
A simple example:

```ts
import { OnReuseDestroy, OnReuseInit, ReuseHookOnReuseInitType } from '@delon/abc/reuse-tab';

@Component()
export class DemoComponent {
export class DemoComponent implements OnReuseInit, OnReuseDestroy {
_onReuseInit(type: ReuseHookOnReuseInitType) {
console.log('_onReuseInit', type);
}
Expand Down

0 comments on commit ee7bb90

Please sign in to comment.