Skip to content

feat: use webhook (#9) #4

feat: use webhook (#9)

feat: use webhook (#9) #4

Workflow file for this run

---
name: Release
on: # yamllint disable-line rule:truthy
push:
branches:
- main
env:
REGISTRY: wandelbots.azurecr.io
IMAGE_NAME: nova-services/zivid-intel
CATALOG_ENTRY_NAME: zivid-intel
jobs:
release-artifacts:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: abatilo/actions-poetry@v2
- uses: docker/setup-buildx-action@v3
- name: Bump Version
uses: go-semantic-release/action@v1
id: release
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Azure Container Registry
if: steps.release.outputs.version != ''
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.PUBLIC_REGISTRY_CI_SCOPE_NOVA_SERVICES_USERNAME }}
password: ${{ secrets.PUBLIC_REGISTRY_CI_SCOPE_NOVA_SERVICES_TOKEN }}
- name: Push Docker Image
if: steps.release.outputs.version != ''
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.release.outputs.version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Bump Pyproject
if: steps.release.outputs.version != ''
run: poetry version ${{ steps.release.outputs.version }}
- name: Commit Pyproject Updates
uses: EndBug/add-and-commit@v9
if: steps.release.outputs.version != ''
with:
message: "chore(version): bump"
default_author: github_actions
add: pyproject.toml
- name: Update Catalog Entry
if: steps.release.outputs.version != ''
env:
GH_TOKEN: ${{ secrets.CATALOG_TOKEN }}
IMAGE: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.release.outputs.version }}"
VERSION: "${{ steps.release.outputs.version }}"
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GH_TOKEN}" \
https://api.github.com/repos/wandelbotsgmbh/catalog/dispatches \
-d "{\"event_type\": \"update-entry\",
\"client_payload\": {
\"image\":\"${IMAGE}\",
\"version\":\"${VERSION}\",
\"entry\":\"${CATALOG_ENTRY_NAME}\"
}
}"