Skip to content

Commit

Permalink
fix: fix dockerhub push
Browse files Browse the repository at this point in the history
  • Loading branch information
Net-Mist committed Jan 12, 2024
1 parent 2d42a1e commit e4ff929
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Prepare version variable
run: |
TAG=${{ github.ref_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Build and push Docker cli image
uses: docker/build-push-action@v5
with:
context: .
file: ./cli.Dockerfile
push: true
tags: netmist/give-me-the-odds${{ github.ref_name }}
tags: netmist/give-me-the-odds:${{ env.VERSION }}
- name: Build and push Docker server image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: netmist/millennium-falcon${{ github.ref_name }}
tags: netmist/millennium-falcon:${{ env.VERSION }}
20 changes: 14 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

- [Tell me the odds](#tell-me-the-odds)
- [Architecture](#architecture)
- [Domain model](#domain-model)
- [Domain models](#domain-models)
- [Domain services](#domain-services)
- [Application services](#application-services)
- [Infrastructure service](#infrastructure-service)
- [Infrastructure services](#infrastructure-services)
- [Technology stack](#technology-stack)
- [CI](#ci)
- [Test](#test)
Expand All @@ -20,9 +20,15 @@ With a recent version of rust (tested with 1.75.0), you can build the project wi

Note that when starting, the webserver will create a folder `logs` containing a file `millennium.log.{date}` with the log of the server. stdio will be pretty silent if everything goes well. The server will be listening on `0.0.0.0:8000`.

It is also possible to start the server with docker by running `docker build -t millennium-falcon .` then `docker run -it --rm -v ./logs:/app/logs -v ./examples:/app/examples -p 0.0.0.0:8000:8000 millennium-falcon examples/millennium-falcon.json`
It is also possible to start the server and the cli with docker.

and the cli by running `docker build -t give-me-the-odds -f cli.Dockerfile .` then `docker run -it --rm -v ./examples:/app/examples give-me-the-odds examples/millennium-falcon.json examples/example1/empire.json`
First

- Build the docker images locally by running `docker build -t millennium-falcon .` or `docker build -t give-me-the-odds -f cli.Dockerfile .`
- Or pull the images from dockerhub: `docker pull netmist/give-me-the-odds:0.3.0`, `docker pull netmist/millenium-falcon:0.3.0`

Then run the server with `docker run -it --rm -v ./logs:/app/logs -v ./examples:/app/examples -p 0.0.0.0:8000:8000 millennium-falcon examples/millennium-falcon.json`
and the cli with `docker run -it --rm -v ./examples:/app/examples give-me-the-odds examples/millennium-falcon.json examples/example1/empire.json`

## Architecture

Expand Down Expand Up @@ -61,17 +67,19 @@ This code was written in Rust 1.75.0. Notables dependencies are :

## CI

2 GitHub workflows are defined.
4 GitHub workflows are defined.

- One that performs a security audit every day. More specifically:
- Cargo-deny check for security vulnerabilities, license violation, unmaintained projects and several other things.
- Cargo-audit for a second security audit. Seems to be more precise than cargo-deny, and also automatically open issue on security vulnerabilities. (see for instance [this issue](https://github.com/Net-Mist/tell-me-the-odds/issues/1))
- A second that run the classic steps:
- A second that run the classic steps at every push:
- format with `cargo-fmt`
- lint with `clippy`
- build and test in dev mode
- build and test again in release mode
- compute and publish code coverage
- The third integrate `release-please` to automatically create GitHub releases, version bumps and changelog generation.
- The last one build and publish docker images to dockerhub when a new tag is pushed.

## Test

Expand Down

0 comments on commit e4ff929

Please sign in to comment.