diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1b24600 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +Dockerfile +log +test +.git +.* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38cfc10..08f0e5d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: CI +name: CI main # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..093bc1e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +# This is a basic workflow to help you get started with Actions + +name: CI release + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + tags: + - v* + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + test: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Run tests + uses: onichandame/python-test-action@master + + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Publish Image + uses: matootie/github-docker@v2.2.2 + with: + accessToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 42d72cf..f8a0502 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ # Other *pycache* +.vscode \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..904249c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.6-alpine +RUN mkdir /app +WORKDIR /app +ADD requirements.txt . +RUN pip install -r requirements.txt +ADD . . + +ENTRYPOINT python pyndemic.py \ No newline at end of file diff --git a/README.md b/README.md index a45825d..cb94dca 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,12 @@ And for running test game session you can type: python3 pyndemic.py test/test_input.txt 42 ``` +### Docker build & run +```bash +docker build -t pyndemic --rm . +docker run --rm -ti pyndemic +``` + --- ## From [Developer Zero][ref-user] **What is this?**