-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
|
||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |