diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..240e7d6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build and Push Docker Images + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Read restic version + id: getversion + run: echo "::set-output name=version::$(grep -oP '(?<=restic/restic:)[\d\.]+' Dockerfile)" + + - name: Print version + run: echo ${{ steps.getversion.outputs.version }} + + - name: Build and push the image + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/querateam/resticronic:${{ steps.getversion.outputs.version }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..647ae8c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM restic/restic:0.17.3 + +RUN apk add --no-cache tzdata tini supercronic + +ENTRYPOINT ["/sbin/tini", "--"]