diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4755c37e7..53f4b491c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,3 +52,20 @@ jobs: - name: Run tests run: | ./run_tests + + docker-build: + name: Docker Image Build + runs-on: ubuntu-22.04 + needs: tests + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v2 + - name: Build and Push to GitHub Container Registry + uses: docker/build-push-action@v1 + with: + push: true + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + repository: devosoft/avida + registry: ghcr.io + add_git_labels: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..c4052a718 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:22.04 + +# Install necessary packages +RUN apt-get update && apt-get install -y \ + git \ + cmake \ + g++ \ + make \ + ccache \ + libncurses5-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY . /avida +WORKDIR "/avida" + +RUN git submodule update --init --recursive + +# Build Avida +RUN ./build_avida + +# Set Avida executable as entrypoint +ENTRYPOINT ["/avida/cbuild/work/avida"]