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 c172fa8
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Publish Asterisc Images

on: [workflow_dispatch, workflow_call, push]

env:
REGISTRY: ghcr.io

jobs:
build-pipelines:
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 }}
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 c172fa8

Please sign in to comment.