Support single-topic workspaces #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow tests and releases a new version of the package, then publishes it to PyPi and the | |
# `octue/create-push-subscription` Docker Hub repository. | |
name: Release | |
# Only trigger when a pull request into main branch is merged. | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Check pyproject.toml file | |
run: poetry check | |
- name: Get package version | |
id: get-package-version | |
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get-package-version.outputs.PACKAGE_VERSION }} | |
release_name: ${{ github.event.pull_request.title }} | |
body: ${{ github.event.pull_request.body }} | |
draft: false | |
prerelease: false | |
outputs: | |
package_version: ${{ steps.get-package-version.outputs.PACKAGE_VERSION }} | |
docker: | |
runs-on: ubuntu-latest | |
needs: release | |
timeout-minutes: 300 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Log in to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v2.8.0 | |
with: | |
context: . | |
push: true | |
tags: octue/create-push-subscription:${{ needs.release.outputs.package_version }},octue/create-push-subscription:latest |