Skip to content

Commit

Permalink
feat: Docker release
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Sep 10, 2024
1 parent 8e7d7bd commit bc1e160
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Publish Asterisc Images

on: [workflow_dispatch, workflow_call]

env:
REGISTRY: ghcr.io

jobs:
build-asterisc-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
IMAGE_NAME: ${{ github.repository }}/asterisc
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Authenticate with container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and Publish `asterisc`
uses: docker/build-push-action@v6
with:
file: Dockerfile.release
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
20 changes: 20 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.21.1-alpine3.18 AS builder
WORKDIR /build
ARG ASTERISC_TAG

# Copy the context into the container
ADD . .

# Install deps
RUN apk add --no-cache git make bash

# Clone and build Asterisc @ `ASTERISC_TAG`
RUN make && \
cp rvgo/bin/asterisc /asterisc-bin

FROM alpine:3.18 AS export

RUN apk add --no-cache bash
SHELL ["/bin/bash", "-c"]

COPY --from=builder /asterisc-bin /asterisc-bin

0 comments on commit bc1e160

Please sign in to comment.