diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..118f5d3 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,45 @@ +name: docker push +on: [push] +jobs: + push_to_registry: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Docker meta + if: startsWith(github.ref, 'refs/tags/') + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: ghcr.io/${{ github.repository }} + tag-match: v(.*) + - name: Set up QEMU + if: startsWith(github.ref, 'refs/tags/') + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + if: startsWith(github.ref, 'refs/tags/') + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to GitHub Container Registry + if: startsWith(github.ref, 'refs/tags/') + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + builder: ${{ steps.buildx.outputs.name }} + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.docker_meta.outputs.tags }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + push: true \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5a62ecf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:3.13.4 + +COPY ./mo . +RUN apk add --update bash && \ + chmod +x mo &&\ + mv mo /usr/local/bin/mo && \ + rm -rf /var/cache/apk/* + +WORKDIR /opt + +ENTRYPOINT ["/usr/local/bin/mo"] \ No newline at end of file