Skip to content

Commit

Permalink
ci: enable semantic releases
Browse files Browse the repository at this point in the history
  • Loading branch information
paddatrapper committed Jun 30, 2022
1 parent 6abeab9 commit 6531708
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 22 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Build
name: Semantic release

on:
push:
branches: [main]
workflow_dispatch: {}

jobs:
publish-docker:
semantic-release:
runs-on: ubuntu-latest

env:
Expand All @@ -16,23 +17,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Login to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags: ["*.*.*"]

jobs:
publish-docker:
runs-on: ubuntu-latest

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Login to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
7 changes: 7 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
branches:
- main
tagFormat: '${version}'
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/github'

0 comments on commit 6531708

Please sign in to comment.