Skip to content

Commit

Permalink
Set up CI/CD for December release (#3)
Browse files Browse the repository at this point in the history
* CICD for December pcesapps release

* cicd

* cicd

* cicd

* cicd
  • Loading branch information
illinoisrobert authored Dec 4, 2024
1 parent db7f2f1 commit 20ec21c
Show file tree
Hide file tree
Showing 2 changed files with 31 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 -u +%s)
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
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Usage:
#
# docker build -t pcesapps-dev:latest -t pcesapps:latest .
# docker run -it --rm -v ~/pcesapps/extern:/tmp/extern ghcr.io/iti/pcesapps-dev
# docker run -it --rm -v ~/pcesapps/extern:/tmp/extern ghcr.io/iti/pcesapps
#
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" to map in /tmp/extern
WORKDIR /tmp/extern

0 comments on commit 20ec21c

Please sign in to comment.