diff --git a/.github/workflows/docker-compose.yml b/.github/workflows/docker-compose-develop.yml similarity index 76% rename from .github/workflows/docker-compose.yml rename to .github/workflows/docker-compose-develop.yml index 795eb5d..078d628 100644 --- a/.github/workflows/docker-compose.yml +++ b/.github/workflows/docker-compose-develop.yml @@ -1,9 +1,9 @@ name: docker-compose-workflow on: push: - branches: [ "main", "develop" ] + branches: [ "develop" ] pull_request: - branches: [ "main", "develop" ] + branches: [ "develop" ] jobs: test: diff --git a/.github/workflows/docker-compose-main.yml b/.github/workflows/docker-compose-main.yml new file mode 100644 index 0000000..60954ef --- /dev/null +++ b/.github/workflows/docker-compose-main.yml @@ -0,0 +1,29 @@ +name: docker-compose-workflow +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test: + runs-on: ubuntu-20.04 + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: brianpondi/openeocubes:latest + + - name: Run docker-compose + run: docker-compose up -d diff --git a/Dockerfile b/Dockerfile index 3c3dd8f..44522db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,4 +34,4 @@ RUN Rscript -e "remotes::install_local('/opt/dockerfiles',dependencies=TRUE)" # cmd or entrypoint for startup CMD ["R", "-q", "--no-save", "-f /opt/dockerfiles/Dockerfiles/start.R"] -EXPOSE 8000 +EXPOSE 8000 \ No newline at end of file