Skip to content

Commit

Permalink
fixed release workflow, added docker release
Browse files Browse the repository at this point in the history
  • Loading branch information
klubi committed Nov 28, 2022
1 parent d91ce12 commit 32d2fbb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
tags:
- "*.*.*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAG: ${{ github.ref_name }}

jobs:
release-binary:
runs-on: ubuntu-latest
Expand All @@ -22,5 +27,45 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
scepserver-.*.zip
scepclient-.*.zip
scepserver-*.zip
scepclient-*.zip
release-docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Build
shell: bash
run: make docker

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

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

- name: Docker build & push
uses: docker/build-push-action@v3
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM alpine:latest
RUN adduser scep --uid 1010 --disabled-password --gecos ""

COPY ./scepserver-linux-amd64 /usr/bin/scepserver
COPY ./scepclient-linux-amd64 /usr/bin/scepclient
RUN chown scep:scep /usr/bin/scepserver
RUN chown scep:scep /usr/bin/scepclient

EXPOSE 8080

Expand Down

0 comments on commit 32d2fbb

Please sign in to comment.