mirror of
https://github.com/elyby/docs.git
synced 2024-11-23 05:33:05 +05:30
Upgrade CI pipeline
This commit is contained in:
parent
6e82e995e9
commit
1d39173246
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
@ -13,32 +13,27 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v5
|
||||||
|
id: setup-python
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
|
cache: pipenv
|
||||||
|
|
||||||
- name: Install pipenv
|
- name: Install pipenv
|
||||||
run: pip install pipenv
|
run: pip install pipenv
|
||||||
|
|
||||||
- id: cache-pipenv
|
|
||||||
name: Download cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ~/.local/share/virtualenvs
|
|
||||||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.cache-pipenv.outputs.cache-hit != 'true'
|
if: steps.setup-python.outputs.cache-hit != 'true'
|
||||||
run: pipenv install --deploy --dev
|
run: pipenv install --deploy --dev
|
||||||
|
|
||||||
- name: Build gettext strings
|
- name: Build gettext strings
|
||||||
run: pipenv run sphinx-build -b gettext source build/locale
|
run: pipenv run sphinx-build -b gettext source build/locale
|
||||||
|
|
||||||
- name: Push and Pull strings from the Crowdin
|
- name: Push and Pull strings from the Crowdin
|
||||||
uses: crowdin/github-action@1.1.0
|
uses: crowdin/github-action@1
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||||
@ -57,7 +52,7 @@ jobs:
|
|||||||
run: pipenv run python build-multilang.py
|
run: pipenv run python build-multilang.py
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
path: build
|
path: build
|
||||||
@ -71,7 +66,7 @@ jobs:
|
|||||||
gh_pages_exists=$(git ls-remote --heads origin gh-pages)
|
gh_pages_exists=$(git ls-remote --heads origin gh-pages)
|
||||||
if [[ -z ${gh_pages_exists} ]]; then
|
if [[ -z ${gh_pages_exists} ]]; then
|
||||||
echo "::warning::gh_pages branch doesn't exists"
|
echo "::warning::gh_pages branch doesn't exists"
|
||||||
echo "::set-output name=should-continue::false"
|
echo "should-continue=false" >> $GITHUB_OUTPUT
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -87,12 +82,13 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "::set-output name=should-continue::$diff_detected"
|
echo "should-continue=$diff_detected" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Deploy to the GitHub Pages
|
- name: Deploy to the GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@4.1.0
|
uses: JamesIves/github-pages-deploy-action@4
|
||||||
if: |
|
if: |
|
||||||
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
|
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master') ||
|
||||||
(github.event_name == 'schedule' && steps.detect-diffs.outputs.should-continue == 'true')
|
(github.event_name == 'schedule' && steps.detect-diffs.outputs.should-continue == 'true')
|
||||||
with:
|
with:
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
|
Loading…
Reference in New Issue
Block a user