Skip to content

Commit

Permalink
CICD for December pcesapps release
Browse files Browse the repository at this point in the history
  • Loading branch information
illinoisrobert committed Dec 4, 2024
1 parent db7f2f1 commit b85b261
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
run: |
if [ "$GITHUB_REF_TYPE" = "tag" ]
then
echo IMAGE_TYPE=beta
echo IMAGE_TYPE=""
echo IMAGE_TAG=$GITHUB_REF_NAME
else
echo IMAGE_TYPE=dev
echo IMAGE_TAG=
echo IMAGE_TYPE=-dev
echo IMAGE_TAG=$(date -Is)
fi >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -33,4 +33,10 @@ jobs:

- uses: actions/checkout@v4
- name: Build the Docker image
run: cd beta && ./docker-build.sh $IMAGE_TYPE $IMAGE_TAG
# run: ./docker-build.sh $IMAGE_TYPE $IMAGE_TAG
run: |
TAG=ghcr.io/iti/pcesapps$IMAGE_TYPE:$IMAGE_TAG
TAG2=ghcr.io/iti/pcesapps$IMAGE_TYPE:latest
docker build --no-cache -t $TAG -t $TAG2 .
docker push $TAG
docker push $TAG2
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Usage:
#
# docker build -t xxx .
# docker run -it --rm -v /tmp/extern:/extern xxx
#
FROM golang:1.23-bookworm

# Add whatever Debian packages you want here.
RUN apt-get -y update && \
apt-get install --no-install-recommends -y \
vim-nox && \
rm -rf /var/lib/apt/lists/*

# Build the pcesapps app
WORKDIR /pcesapps
COPY . .
RUN cd embedded/sim-dir && go mod tidy && go build -o /bin/sim sim.go exp.go

# remember to use "-v /tmp/extern:/extern"
WORKDIR /extern

0 comments on commit b85b261

Please sign in to comment.