From a3fb4d9e50370ec88bb723c29411d9a5643f316f Mon Sep 17 00:00:00 2001 From: jeoy Date: Fri, 27 Sep 2019 10:00:39 +0800 Subject: [PATCH 1/5] :pencil: update readme --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 0e13c67..3c2464a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,47 @@ This action will auto deploy to target branch when it get triggered +# How to Use + +```yml +name: deploy + +on: + push: + branches: + - master + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Build and Deploy + uses: ./.github/actions/deploy + env: + COMMIT_EMAIL: jeoy_z@126.com + COMMIT_NAME: jeoy + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BASE_BRANCH: master + DEPLOY_BRANCH: gh-pages + BUILD_SCRIPT: yarn && yarn build + FOLDER: build +``` + +## Environment variable + +| param | description | required | default | +| :------------ | :----------------------------------: | -------: | ---------------: | +| COMMIT_NAME | The name who commit this deployment | false | \${GITHUB_ACTOR} | +| COMMIT_EMAIL | The email who commit this deployment | true | - | +| ACCESS_TOKEN | github token can acess repo | true | - | +| BASE_BRANCH | The branch you want to build | false | master | +| DEPLOY_BRANCH | The branch you want to deploy | false | gh-pages | +| BUILD_SCRIPT | e.g. `npm install && npm run build` | true | - | +| FOLDER | The folder generated by build script | true | - | + # How It Works When push to `master` branch From 3dd681a56beeb0cf32378d62c01a843608c526f6 Mon Sep 17 00:00:00 2001 From: jeoy Date: Fri, 27 Sep 2019 10:30:50 +0800 Subject: [PATCH 2/5] :rocket: update Dockerfile to release --- .github/actions/deploy/Dockerfile | 11 +++++++++-- .github/actions/deploy/action.yml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/actions/deploy/Dockerfile b/.github/actions/deploy/Dockerfile index e66475e..9227278 100644 --- a/.github/actions/deploy/Dockerfile +++ b/.github/actions/deploy/Dockerfile @@ -1,8 +1,15 @@ FROM node:10 -LABEL "repository"="https://github.com/jeoy/github-deploy-actions" -LABEL "maintainer"="jeoy " +FROM node:10 +LABEL "com.github.actions.name"="Github Build & Deploy Action" +LABEL "com.github.actions.description"="This action will auto deploy to target branch when it get triggered" +LABEL "com.github.actions.icon"="package" +LABEL "com.github.actions.color"="blue" + +LABEL "repository"="https://github.com/jeoy/its-me" +LABEL "homepage"="https://github.com/jeoy/github-deploy-actions" +LABEL "maintainer"="jeoy " ADD entrypoint.sh /entrypoint.sh diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml index cc3403e..b39ae2c 100644 --- a/.github/actions/deploy/action.yml +++ b/.github/actions/deploy/action.yml @@ -1,4 +1,4 @@ -name: 'auto deploy action' +name: 'Github Build & Deploy Action' description: 'This action will auto deploy to target branch when it get triggered' author: 'jeoy ' From c82c836ab5574ef88faaddaabcfcb86f8f710d2e Mon Sep 17 00:00:00 2001 From: jeoy Date: Fri, 27 Sep 2019 10:34:14 +0800 Subject: [PATCH 3/5] :rocket: update Dockerfile to release --- .github/workflows/deploy.yml | 4 ++-- .github/actions/deploy/Dockerfile => Dockerfile | 0 .github/actions/deploy/action.yml => action.yml | 0 .github/actions/deploy/entrypoint.sh => entrypoint.sh | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename .github/actions/deploy/Dockerfile => Dockerfile (100%) rename .github/actions/deploy/action.yml => action.yml (100%) rename .github/actions/deploy/entrypoint.sh => entrypoint.sh (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 61d7d60..3c638d0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: deploy on: push: branches: - - develop + - master jobs: build-and-deploy: @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@master - name: Build and Deploy - uses: ./.github/actions/deploy + uses: jeoy/github-deploy-actions@master env: COMMIT_EMAIL: jeoy_z@126.com COMMIT_NAME: jeoy diff --git a/.github/actions/deploy/Dockerfile b/Dockerfile similarity index 100% rename from .github/actions/deploy/Dockerfile rename to Dockerfile diff --git a/.github/actions/deploy/action.yml b/action.yml similarity index 100% rename from .github/actions/deploy/action.yml rename to action.yml diff --git a/.github/actions/deploy/entrypoint.sh b/entrypoint.sh similarity index 100% rename from .github/actions/deploy/entrypoint.sh rename to entrypoint.sh From 3f8d1ed7d1d75b19be105a68af17a9a627d646cd Mon Sep 17 00:00:00 2001 From: jeoy Date: Fri, 27 Sep 2019 11:00:21 +0800 Subject: [PATCH 4/5] :pencil: update readme --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3c2464a..9e6cf44 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # Github-deploy-actions -This action will auto deploy to target branch when it get triggered +This action will auto build and deploy to target branch when it get triggered. + +Also it can preserve the history of gh-pages and convenient for rolling back to +previous version. + +And it will compare deployment file to previous version by using +`git status --porcelain`, it will not to deploy if nothing change. # How to Use @@ -55,9 +61,9 @@ Then push `build` folder as a new commit on `gh-pages` branch # deploy page: -[demo](https://jeoy.github.io/github-deploy-actions/) +[gh-pages demo](https://jeoy.github.io/github-deploy-actions/) ## what exactly is done during the action checkout this -[shell](https://github.com/jeoy/github-deploy-actions/blob/develop/.github/actions/deploy/entrypoint.sh) +[entrypoint.sh](https://github.com/jeoy/github-deploy-actions/blob/master/entrypoint.sh) From 3bd54bb31e62dac1364c0929b4685bd49b4a58b4 Mon Sep 17 00:00:00 2001 From: jeoy Date: Fri, 27 Sep 2019 11:23:57 +0800 Subject: [PATCH 5/5] :lipstick:test && fire deploy action --- src/App.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.css b/src/App.css index 13ba26b..bc0a082 100644 --- a/src/App.css +++ b/src/App.css @@ -23,4 +23,5 @@ span { margin: 10px; + margin-bottom: 26px; }