diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1230149 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..5b157f2 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,30 @@ +name: Docker + +on: + push: + pull_request: + schedule: + - cron: "17 3 * * *" + +jobs: + buildx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Docker Login + id: docker-login + if: success() && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Docker Build and Push + if: steps.docker-login.outcome == 'success' + run: ./build.sh "--push" + - name: Docker Build + if: steps.docker-login.outcome == 'skipped' + run: ./build.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2c6ed65..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -dist: xenial -sudo: required -services: - - docker -language: bash -before_script: - # Upgrade Docker and enable experimental mode - - curl -fsSL https://get.docker.com | sh - - echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json - - mkdir $HOME/.docker - - touch $HOME/.docker/config.json - - echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json - - sudo service docker start - - docker info - - docker version -script: - # Enable multi-architecture containers using QEMU - - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - docker buildx create --name xbuilder --use - # Login to Docker Hub and configure push behaviour if we are on master - - > - if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - echo "$DOCKER_PASS" | docker login -u bastilimbach --password-stdin - dopush="--push" - fi - # Build the latest stable MagicMirror release - - ./build.sh ${dopush} -after_script: - - docker logout diff --git a/Dockerfile b/Dockerfile index 1aecfce..114f569 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ RUN cp -R config /opt/default_config RUN npm install --unsafe-perm --silent COPY mm-docker-config.js docker-entrypoint.sh ./ -RUN chmod +x ./docker-entrypoint.sh EXPOSE 8080 ENTRYPOINT ["./docker-entrypoint.sh"] diff --git a/README.md b/README.md index d40cf26..fe7c79a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![DockerHub Badge](https://dockeri.co/image/bastilimbach/docker-magicmirror)](https://hub.docker.com/r/bastilimbach/docker-magicmirror/) -# Why Docker? [![Build Status](https://travis-ci.org/bastilimbach/docker-MagicMirror.svg?branch=master)](https://travis-ci.org/bastilimbach/docker-MagicMirror) +# Why Docker? [![Build Status](https://github.com/bastilimbach/docker-MagicMirror/workflows/Docker/badge.svg?branch=master)](https://github.com/bastilimbach/docker-MagicMirror/actions?query=workflow%3ADocker) In some cases, you want to start the application without an actual app window. In this case, you can start MagicMirror² in server only mode by manually running `node serveronly` or using Docker. This will start the server, after which you can open the application in your browser of choice. @@ -14,7 +14,7 @@ In some cases, you want to start the application without an actual app window. I - `develop` - Image based on the [`develop`](https://github.com/MichMich/MagicMirror/tree/develop) branch. - `vX.Y.Z`- Specific MagicMirror release. Take a look at the [releases](https://github.com/MichMich/MagicMirror/releases) page in the MagicMirror repository to get the correct version number. -> The respective docker images are getting updated daily by a cron job from Travis CI. +> The respective docker images are getting updated daily by a GitHub Actions cron job. # Run MagicMirror² in server only mode diff --git a/build.sh b/build.sh index 1ff6a00..6a7ce99 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ set -e # https://stackoverflow.com/a/51761312/4934537 latest_release=$(git ls-remote --tags --refs --sort="v:refname" https://github.com/MichMich/MagicMirror.git | tail -n1 | sed 's/.*\///') -if [ "$(docker manifest inspect bastilimbach/docker-magicmirror:"${latest_release}" > /dev/null; echo $?)" != 0 ]; then +if [ "$(DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect bastilimbach/docker-magicmirror:"${latest_release}" > /dev/null; echo $?)" != 0 ]; then docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 ${1} --build-arg branch="${latest_release}" -t bastilimbach/docker-magicmirror:"${latest_release}" -t bastilimbach/docker-magicmirror:latest . fi diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh old mode 100644 new mode 100755