From c44548a55a10f5458eb250174e5e52a8afb8e0ee Mon Sep 17 00:00:00 2001 From: Kevin Putnam Date: Wed, 26 Feb 2020 13:48:09 -0800 Subject: [PATCH] GitHub Actions Support (#1043) * Adding GitHub workflow for checking PRs. Signed-off-by: Kevin Putnam * Added carriage return to end of document. Signed-off-by: Kevin Putnam * Adds build on push to master deploying to developmentHTML branch. Adds build on push to publish deploying to latestHTML branch. Signed-off-by: Kevin Putnam * Uncomment publish URL. Signed-off-by: Kevin Putnam * Renamed Travis CI/CD file to avoid running it. Signed-off-by: Kevin Putnam --- .github/workflows/check.yml | 23 +++++++++++++++++++ .github/workflows/main.yml | 39 +++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 43 +++++++++++++++++++++++++++++++++++ .travis.yml => notravis.yml | 0 4 files changed, 105 insertions(+) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/publish.yml rename .travis.yml => notravis.yml (100%) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..5ad76c5e --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,23 @@ +name: Check + +on: [pull_request] + + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + run: | + export PATH="$HOME/.local/bin:$PATH" + sudo apt-get install -y python3-setuptools + pip3 install --user -r requirements.txt + - name: Build the docs + run: | + export PATH="$HOME/.local/bin:$PATH" + make py + make htmlall + \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..2831e86e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + run: | + export PATH="$HOME/.local/bin:$PATH" + sudo apt-get install -y python3-setuptools + pip3 install --user -r requirements.txt + - name: Build the docs + run: | + export PATH="$HOME/.local/bin:$PATH" + make py + make htmlall + - name: Pre-deploy + run: | + wget https://github.com/clearlinux/clear-linux-documentation-zh-CN/releases/latest/download/clearlinux-docs-zh-CN.tar.gz + mkdir source/_build/html/zh_CN + tar xvzf clearlinux-docs-zh-CN.tar.gz -C source/_build/html/zh_CN + mv source/_build/html $HOME/output + - name: Deploy the docs + run: | + cd $HOME/output + git init + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@github.com" + git add . + git commit -m "latest html output" + git push -f https://${GITHUB_ACTOR}:${{secrets.ACCESS_TOKEN}}@github.com/clearlinux/clear-linux-documentation.git HEAD:developmentHTML diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..e02ebb06 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Publish + +on: + push: + branches: + - publish + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + run: | + export PATH="$HOME/.local/bin:$PATH" + sudo apt-get install -y python3-setuptools + pip3 install --user -r requirements.txt + - name: Build the docs + run: | + export PATH="$HOME/.local/bin:$PATH" + make py + make htmlall + - name: Pre-deploy + run: | + wget https://github.com/clearlinux/clear-linux-documentation-zh-CN/releases/latest/download/clearlinux-docs-zh-CN.tar.gz + mkdir source/_build/html/zh_CN + tar xvzf clearlinux-docs-zh-CN.tar.gz -C source/_build/html/zh_CN + mv source/_build/html $HOME/output + - name: Deploy the docs + run: | + cd $HOME/output + git init + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@github.com" + git add . + git commit -m "latest html output" + git push -f https://${GITHUB_ACTOR}:${{secrets.ACCESS_TOKEN}}@github.com/clearlinux/clear-linux-documentation.git HEAD:latestHTML + - name: Publish the docs + run: | + wget ${{secrets.PUBLISH_URL}} + cat clearlinux-latest diff --git a/.travis.yml b/notravis.yml similarity index 100% rename from .travis.yml rename to notravis.yml