-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add docker build environment and deploy
Problem: a developer may want an environment with everything ready to go Solution: provide a Dockerfile to build, akin to the VSCode environment, but not requiring VSCode. Have it push to an automated release so it is always available. Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
3 changed files
with
83 additions
and
1 deletion.
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,44 @@ | ||
name: build docker fluxion-go | ||
|
||
on: | ||
pull_request: [] | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: make and build docker containers | ||
env: | ||
container: ghcr.io/flux-framework/fluxion-go | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.19 | ||
- name: GHCR Login | ||
if: (github.event_name != 'pull_request') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Container | ||
run: docker build -t ${{ env.container }} . | ||
|
||
- name: Tag Release Image | ||
if: (github.event_name == 'release') | ||
run: | | ||
tag=${GITHUB_REF#refs/tags/} | ||
echo "Tagging and releasing ${{ env.container}}:${tag}" | ||
docker tag ${{ env.container }}:latest ${{ env.container }}:${tag} | ||
- name: Deploy Container | ||
if: (github.event_name != 'pull_request') | ||
run: docker push ${{ env.container }} --all-tags |
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 fluxrm/flux-sched:bookworm-amd64 | ||
|
||
# Basic container to provide quick developer environment with everything ready to go | ||
|
||
LABEL maintainer="Vanessasaurus <@vsoch>" | ||
|
||
USER root | ||
RUN apt-get update && apt-get install -y less | ||
|
||
# Install Go 19 (we should update this) | ||
RUN wget https://go.dev/dl/go1.19.10.linux-amd64.tar.gz && tar -xvf go1.19.10.linux-amd64.tar.gz && \ | ||
mv go /usr/local && rm go1.19.10.linux-amd64.tar.gz | ||
ENV PATH=$PATH:/usr/local/go/bin:/home/vscode/go/bin | ||
|
||
RUN git clone https://github.com/flux-framework/flux-sched /opt/flux-sched | ||
|
||
# Assuming installing to /usr/local | ||
ENV LD_LIBRARY_PATH=/usr/lib:/usr/lib/flux:/usr/local/lib | ||
WORKDIR /workspace/fluxion-go | ||
COPY . . |
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