Skip to content

Commit 512965c

Browse files
authored
Merge pull request #9 from kWeglinski/chore/github-releases
chore: Github actions updated to create github release and tags
2 parents 0934f48 + 24e1a73 commit 512965c

File tree

3 files changed

+72
-39
lines changed

3 files changed

+72
-39
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Docker CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v3
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Extract version from package.json
22+
id: extract_version
23+
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
24+
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
31+
- name: Build and push
32+
uses: docker/build-push-action@v6
33+
with:
34+
push: true
35+
tags: |
36+
kweg/omnipoly:${{ steps.extract_version.outputs.version }}
37+
kweg/omnipoly:latest
38+
39+
- name: Extract changelog for the version
40+
id: extract_changelog
41+
run: |
42+
VERSION=${{ steps.extract_version.outputs.version }}
43+
CHANGELOG=$(grep -A 10 "### $VERSION" changelog.md | tail -n +2)
44+
echo "::set-output name=changelog::$CHANGELOG"
45+
46+
- name: Create GitHub Release
47+
id: create_release
48+
uses: actions/create-release@v1
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
tag_name: v${{ steps.extract_version.outputs.version }}
53+
release_name: Release v${{ steps.extract_version.outputs.version }}
54+
body: |
55+
### Changelog
56+
57+
${{ steps.extract_changelog.outputs.changelog }}
58+
59+
### Build Results
60+
${{ steps.build_push.outputs.digest }}
61+
draft: false
62+
prerelease: false
63+
64+
- name: Create GitHub Tag
65+
run: |
66+
git config --global user.name 'github-actions[bot]'
67+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
68+
git tag v${{ steps.extract_version.outputs.version }}
69+
git push origin v${{ steps.extract_version.outputs.version }}

.github/workflows/docker-image.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

changelog.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
### Unreleased
22

3-
- Added nightly builds on develop branch
4-
- secops: dependabot - bump vite to 6
3+
- chore: Added nightly builds on develop branch
4+
- secops: dependabot - bump vite to 6 (resolves 6 dependabot warnings)
5+
- chore: Github actions updated to create github release and tags
56

67
### 0.10.4
78

0 commit comments

Comments
 (0)