Skip to content

Commit

Permalink
feat: initialize gitee pages action
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Mar 28, 2020
1 parent c5c1c94 commit 5fae5d3
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.7-slim

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN pip install --upgrade --no-cache-dir requests

COPY "entrypoint.sh" "/entrypoint.sh"
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
# gitee-pages-action
# Gitee Pages action
使用模拟登录,自动部署 Gitee Pages。

> 未完成。
## 入参

| 参数 | 描述 | 是否必传 | 默认值 |
|---|---|---|---|
| `gitee-repo` | Gitee 仓库 || - |
| `gitee-login-cookie` | Gitee 登录后的 cookie || - |
| `branch` | 构建的分支 || `master` |
| `directory` | 构建的目录 || '' |
| `https` | 是否强制 HTTPS || `false` |

## 例子
```yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
source-repo: "[email protected]:doocs/advanced-java.git"
destination-repo: "[email protected]:Doocs/advanced-java.git"

- name: Rebuild Gitee Pages
uses: yanglbme/[email protected]
with:
repository: doocs/advanced-java
cookie: ${{ secrets.GITEE_COOKIE }}
branch: master
```
请到 `Settings` -> `Secrets` 配置 `GITEE_RSA_PRIVATE_KEY` 和 `GITEE_COOKIE`。其中:

- `GITEE_RSA_PRIVATE_KEY`: 存放你的 `id_rsa` 私钥。
- `GITEE_COOKIE`: 存放你登录 Gitee 后的 Cookie。

![](/images/add_secret_key.png)
31 changes: 31 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Gitee Pages Action'
description: 'GitHub Action for Gitee Pages'
author: 'yanglbme'
branding:
icon: 'git-branch'
color: 'gray-dark'
inputs:
gitee-repo:
description: 'The Gitee repository, like doocs/leetcode'
required: true
gitee-login-cookie:
description: 'The Gitee login cookie, like gitee-session-n=BAh7CUkiD...'
required: true
branch:
description: 'Which branch to build'
required: false
default: 'master'
directory:
description: 'Which directory to build'
required: false
default: ''
https:
description: 'Use force https or not'
required: false
default: true
outputs:
result:
description: 'The result of api'
runs:
using: 'docker'
image: 'Dockerfile'
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -l

echo "Hello $1"
Binary file added images/add_secret_key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5fae5d3

Please sign in to comment.