Skip to content

Commit

Permalink
Add release.yml pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
leneffets authored Nov 26, 2024
1 parent f4778c5 commit f114251
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release Pipeline

on:
push:
tags:
- 'v*.*.*' # Nur SemVer Tags (z. B. v1.0.0)

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ssmserver

- name: Get build architecture
id: arch
run: echo "ARCH=$(uname -m)" >> $GITHUB_ENV

- name: Package Binary
run: |
mkdir -p release
ARCH=${{ env.ARCH }}
TAR_NAME="ssmserver-linux-${ARCH}.tar.gz"
tar -czvf release/${TAR_NAME} -C ./output ssmserver
echo "RELEASE_FILE=release/${TAR_NAME}" >> $GITHUB_ENV
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref_name }}
release_name: "Release ${{ github.ref_name }}"
draft: false
prerelease: false
body: |
## Release Notes
- Beschreibung deines Releases hier.
files: ${{ env.RELEASE_FILE }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

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

- name: Build and push Docker image with version tag
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/ssmserver:latest
ghcr.io/${{ github.repository_owner }}/ssmserver:${{ github.ref_name }}

0 comments on commit f114251

Please sign in to comment.