Skip to content

Commit

Permalink
feat: semantic release and docker build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed Oct 23, 2024
0 parents commit 6570fd0
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Reusable workflow for Docker Build

on:
workflow_call:
inputs:
version:
description: 'Version tag of docker build'
required: false
type: string

docker:
name: Docker Build Push
runs-on: ubuntu-latest

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest
type=raw,value=${{ inputs.version }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Reusable workflow for Semantic Release

on:
workflow_call:
inputs:
node_version:
description: 'Which node version for semantic release environment'
default: 20
required: false
type: number
outputs:
version:
description: "Version for next release"
value: ${{ jobs.semantic.outputs.version }}

jobs:
semantic:
name: Semantic Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.semantic-release.outputs.version }}
permissions:
contents: write
issues: write
pull-requests: write

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inouts.node_version }}

- name: Install dependencies
run: npm ci

- name: Run semantic-release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

0 comments on commit 6570fd0

Please sign in to comment.