Skip to content

Commit

Permalink
Merge pull request #39 from lcxfs1991/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lcxfs1991 authored Feb 23, 2024
2 parents 6d3529f + accec6e commit 34a121c
Show file tree
Hide file tree
Showing 308 changed files with 22,913 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Docker Image CI

on:
push:
branches: [ "master", "dev" ]

jobs:

build:

runs-on: ubuntu-latest

steps:

- name: Checkout Github Repo
uses: actions/checkout@v4
with:
# submodules: recursive
submodules: 'true'
token: ${{ secrets.CHECKOUT_REPO_TOKEN }}

- name: Set Branch Name
run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's/refs\/heads\///')" >> $GITHUB_ENV

- name: Set Timestamp
run: echo "TIMESTAMP=$(date +%s%3N)" >> $GITHUB_ENV

- name: Fetch default.conf
uses: valitydev/action-download-file@v1
with:
url: https://raw.githubusercontent.com/lcxfs1991/docschina-deployment/main/docschina-blog/default.conf
target-path: .

- name: Fetch Dockerfile
uses: valitydev/action-download-file@v1
with:
url: https://raw.githubusercontent.com/lcxfs1991/docschina-deployment/main/docschina-blog/Dockerfile
target-path: .


- name: Build docs
run: yarn && yarn build

- name: Docker build
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ccr.ccs.tencentyun.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: ccr.ccs.tencentyun.com/docschina/docschina-blog:${{ env.BRANCH_NAME }}-${{ env.TIMESTAMP }}

- name: Deployment
uses: TencentCloud/cli-action@v1
with:
secret_id: ${{ secrets.SECRET_ID }}
secret_key: ${{ secrets.SECRET_KEY }}
region: ${{ secrets.LIGHTHOUSE_REGION }}
commands: tat InvokeCommand --cli-unfold-argument --region ap-shanghai --CommandId cmd-boc4aaiw --InstanceIds lhins-nkwfootc --Parameters '{"deployment":"docschina-blog","image":"ccr.ccs.tencentyun.com/docschina/docschina-blog:${{ env.BRANCH_NAME }}-${{ env.TIMESTAMP }}"}'
output_format: json
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
.docusaurus/
node_modules
build
41 changes: 41 additions & 0 deletions README 2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Empty file added blog/index.md
Empty file.
5 changes: 5 additions & 0 deletions docs/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
heyli:
name: 李成熙
title: 印记中文创始人
url: https://github.com/lcxfs1991
image_url: /img/avatar.jpeg
Binary file added docs/babel/2016-05-12/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 34a121c

Please sign in to comment.