Skip to content

Commit 9f38f8d

Browse files
committed
Update Docker release workflow
1 parent de96e1d commit 9f38f8d

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@ on:
66
workflow_dispatch:
77

88
jobs:
9+
fetch_version:
10+
name: Fetch release version
11+
runs-on: ubuntu-latest
12+
13+
outputs:
14+
version: ${{ steps.get_version.outputs.version }}
15+
16+
steps:
17+
- name: Get the version
18+
id: get_version
19+
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
20+
921
publish_docker_image:
1022
name: Build & Publish Docker image
1123
runs-on: ubuntu-latest
1224
environment: production
25+
needs: [fetch_version]
1326

1427
steps:
1528
- name: Checkout code
@@ -35,7 +48,7 @@ jobs:
3548
cache-to: type=inline
3649
tags: |
3750
ghcr.io/python-discord/olli:latest
38-
ghcr.io/python-discord/olli:${{ github.event.release.tag_name }}
51+
ghcr.io/python-discord/olli:${{ needs.fetch_version.outputs.version }}
3952
4053
publish_pypi_package:
4154
name: Build & Publish PyPI package
@@ -64,3 +77,16 @@ jobs:
6477
run: poetry publish
6578
env:
6679
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
80+
81+
publish_notification:
82+
name: Publish notification to Discord
83+
runs-on: ubuntu-latest
84+
needs: [publish_pypi_package, publish_docker_image, fetch_version]
85+
86+
steps:
87+
- name: Send Discord notification
88+
env:
89+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
90+
uses: Ilshidur/action-discord@master
91+
with:
92+
args: 'Olli `${{ needs.fetch_version.outputs.version }}` has been published to Docker + PyPI.'

0 commit comments

Comments
 (0)