Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

chore(ci): semantic release #1050

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
---
name: Release Container Image
name: Release

on:
push:
branches: [main]
tags:
- "v*.*.*"

jobs:
container:
semrel:
name: Semantic Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Semantic Release
uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.ADFINISBOT_PAT }}

- name: Bump Version
if: steps.semrel.outputs.version != ''
run: |
pipx run poetry version "${{ steps.semrel.outputs.version }}"

- name: Docker meta
id: meta
if: steps.semrel.outputs.version != ''
uses: docker/metadata-action@v5
with:
images: ghcr.io/adfinis/timed-backend
Expand All @@ -30,19 +41,20 @@ jobs:
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}

- name: Login to GHCR
if: steps.semrel.outputs.version != ''
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build_ghcr
if: steps.semrel.outputs.version != ''
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
push: true
hairmare marked this conversation as resolved.
Show resolved Hide resolved
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}