-
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (59 loc) · 1.89 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CD
on:
pull_request:
branches:
- master
types:
- closed
jobs:
publish:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: relekang/python-semantic-release@v7.34.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Poetry
uses: abatilo/actions-poetry@v2.4.0
with:
poetry-version: 1.2.2
- name: Configure Poetry
run: |
poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3.3.3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
poetry install
- name: Get the release version
run: |
export RELEASE_TAG_VERSION="$( poetry run semantic-release print-version --current )"
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION}" >> $GITHUB_ENV
- name: Configure git
run: |
git config --global user.name Docs deploy
git config --global user.email docs@dummy.bot.com
- name: Publish the documentation
run: |
poetry run mike deploy --push --update-aliases ${RELEASE_TAG_VERSION} latest
poetry run mike set-default --push latest
- name: Publish to GitHub packages
uses: whoan/docker-build-with-cache-action@v6
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
image_name: ${{ github.repository }}/roughgan
image_tag: ${{ env.RELEASE_TAG_VERSION }},latest
context: ./docker/