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

Commit

Permalink
chore(ci): semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Apr 17, 2024
1 parent 81ad005 commit 2cdfe01
Showing 1 changed file with 18 additions and 6 deletions.
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
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}

0 comments on commit 2cdfe01

Please sign in to comment.