Skip to content

Commit 48ead15

Browse files
authored
Auto tag & publish master branch (#93)
1 parent 40c50eb commit 48ead15

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and Push Multi-Arch Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
20+
- name: Log in to Docker Hub
21+
uses: docker/login-action@v2
22+
with:
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
25+
26+
- name: Extract version
27+
id: get_version
28+
run: |
29+
VERSION=$(grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' lib/ruby_language_server/version.rb)
30+
echo "VERSION=$VERSION" >> $GITHUB_ENV
31+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
32+
33+
- name: Build and push multi-arch Docker image
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
platforms: linux/amd64,linux/arm64
38+
push: true
39+
tags: |
40+
kwerle/ruby_language_server:latest
41+
kwerle/ruby_language_server:${{ env.VERSION }}
42+
43+
- name: Create GitHub release
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
tag_name: v${{ env.VERSION }}
47+
name: v${{ env.VERSION }}
48+
generate_release_notes: true
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)