diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..a6f88be --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,78 @@ +name: Docker CI + +on: + push: + tags: + - 'v*' + +jobs: + docker-build: + strategy: + matrix: + arch: [amd64, arm64] + runs-on: ubuntu-latest + steps: + - name: Checkout project + uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: wantguns + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Building the ${{ matrix.arch }} image + run: | + docker build . \ + -t wantguns/bin:${{ matrix.arch }} \ + --build-arg ARCH=${{ matrix.arch }} + mkdir -p artifacts/images + docker save wantguns/bin:${{ matrix.arch }} > artifacts/images/${{ matrix.arch }}.tar + + - name: Pushing the ${{ matrix.arch }} image + run: | + docker push wantguns/bin:${{ matrix.arch }} + + - name: Temporarily saving the image + uses: actions/upload-artifact@v2 + with: + name: docker-artifacts + path: artifacts/images + retention-days: 1 + + + docker-push: + needs: docker-build + runs-on: ubuntu-latest + steps: + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: wantguns + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Retrieve saved images + uses: actions/download-artifact@v2 + with: + name: docker-artifacts + path: artifacts/images + + - name: Docker load images + run: | + pushd artifacts/images + docker load < amd64.tar + docker load < arm64.tar + + - name: Creating a multi-arch manifest + run: | + docker manifest create \ + wantguns/bin:latest \ + --amend wantguns/bin:amd64 \ + --amend wantguns/bin:arm64 + + docker manifest annotate wantguns/bin:latest \ + wantguns/bin:arm64 --arch arm64 + + - name: Push the manifest + run: | + docker manifest push wantguns/bin:latest \ No newline at end of file diff --git a/readme.md b/readme.md index c1bee50..b73d13e 100644 --- a/readme.md +++ b/readme.md @@ -193,6 +193,6 @@ BIN_IDENT=false This pastebin: - does not use a database. It lacks non-essential features like password-protection / automatic deletion as a result of which, it can do completely fine with flat filesystems. As an upside (opinionated), it makes deploying it easier. -- uses server sided highlighting, which ensures that everything stays light and snappy at the server side. +- uses server sided highlighting, which ensures that everything stays light and snappy at the client side. - uses very minimal frontend because a pastebin does not need it. It focuses (or atleast tries to) on getting things done in minimum amount of clicks.