Skip to content

Commit 9ec8c67

Browse files
authored
Merge pull request #490 from fwcd/update-docker-ci
Extract Docker build into separate workflow
2 parents 80fce77 + 2220a1a commit 9ec8c67

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ jobs:
3838
run: |
3939
tag="${{ steps.tag.outputs.tag }}"
4040
gh release upload "$tag" {server,grammars}/build/distributions/*
41-
- name: Deploy Docker image to GitHub Packages
42-
uses: docker/build-push-action@v1
43-
with:
44-
username: ${{ github.actor }}
45-
password: ${{ secrets.GITHUB_TOKEN }}
46-
registry: docker.pkg.github.com
47-
repository: fwcd/kotlin-language-server/server
48-
tag_with_ref: true
4941
- name: Deploy Maven artifacts to GitHub Packages
5042
run: ./gradlew :shared:publish :server:publish
5143
env:

.github/workflows/docker.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags:
7+
- '*'
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'fwcd/kotlin-language-server'
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v2
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
- name: Log in to GHCR
22+
uses: docker/login-action@v1
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- id: meta
28+
uses: docker/metadata-action@v4
29+
with:
30+
images: fwcd/kotlin-language-server
31+
- name: Build and push image
32+
uses: docker/build-push-action@v4
33+
with:
34+
context: .
35+
platforms: linux/amd64,linux/arm64/v8
36+
push: ${{ github.ref == 'refs/heads/main' }}
37+
tags: ${{ steps.meta.output.tags }}
38+
labels: ${{ steps.meta.output.labels }}

0 commit comments

Comments
 (0)