From aa222bd2cb6c3599b57121961da40ae9f81eda79 Mon Sep 17 00:00:00 2001 From: bestony Date: Sat, 16 Jan 2021 13:40:35 +0800 Subject: [PATCH] add new action --- .github/workflows/lctt-article-badge.yml | 36 ++++++++++++++++++++++ .github/workflows/lctt-article-status.yml | 37 +++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/lctt-article-badge.yml create mode 100644 .github/workflows/lctt-article-status.yml diff --git a/.github/workflows/lctt-article-badge.yml b/.github/workflows/lctt-article-badge.yml new file mode 100644 index 0000000000..a78d6ed405 --- /dev/null +++ b/.github/workflows/lctt-article-badge.yml @@ -0,0 +1,36 @@ +name: LCTT Article Badge + +on: + push: + branches: [master] +jobs: + build: + runs-on: ubuntu-latest + env: + TRAVIS_REPO_SLUG: ${{ github.repository }} + TRAVIS_BRANCH: master + TRAVIS_PULL_REQUEST: ${{ github.event.number }} + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + steps: + - name: Set ENV variables + run: | + echo "::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}" + echo "::set-env name=TRAVIS_EVENT_TYPE::$(if [ "schedule" == "${{ github.event_name }}" ]; then echo "cron"; else echo "${{ github.event_name }}"; fi)" + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: checkout old pages branch + uses: actions/checkout@v2 + with: + repository: lctt/translateproject + path: build + ref: gh-pages + - name: remove pages .git + run: rm -rf ./build/.git + - name: run badge + run: sh ./scripts/badge.sh; + - uses: crazy-max/ghaction-github-pages@v2.2.0 + with: + build_dir: ./build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lctt-article-status.yml b/.github/workflows/lctt-article-status.yml new file mode 100644 index 0000000000..ecbe8bcb85 --- /dev/null +++ b/.github/workflows/lctt-article-status.yml @@ -0,0 +1,37 @@ +name: LCTT Article Status + +on: + schedule: + - cron: "*/30 * * * *" + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + env: + TRAVIS_REPO_SLUG: ${{ github.repository }} + TRAVIS_BRANCH: master + TRAVIS_PULL_REQUEST: ${{ github.event.number }} + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + steps: + - name: Set ENV variables + run: | + echo "::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}" + echo "::set-env name=TRAVIS_EVENT_TYPE::$(if [ "schedule" == "${{ github.event_name }}" ]; then echo "cron"; else echo "${{ github.event_name }}"; fi)" + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: checkout old pages branch + uses: actions/checkout@v2 + with: + repository: lctt/translateproject + path: build + ref: gh-pages + - name: remove pages .git + run: rm -rf ./build/.git + - name: run status + run: sh ./scripts/status.sh; + - uses: crazy-max/ghaction-github-pages@v2.2.0 + with: + build_dir: ./build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}