Skip to content

Commit cb503f4

Browse files
committed
Push to github registry
1 parent 049fdf6 commit cb503f4

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,50 @@ jobs:
4949
- uses: softprops/action-gh-release@v1
5050
if: startsWith(github.ref, 'refs/tags/')
5151
with:
52-
files: ${{ matrix.filename }}
52+
files: ${{ matrix.filename }}
53+
- run: mv ${{ matrix.filename }} git-backup
54+
- uses: actions/upload-artifact@v2
55+
with:
56+
name: binary-${{ matrix.filename }}
57+
path: git-backup
58+
build_docker:
59+
needs:
60+
- build
61+
name: Build Docker
62+
runs-on: ubuntu-20.04
63+
steps:
64+
- uses: actions/checkout@v2
65+
- uses: actions/download-artifact@v2
66+
with:
67+
name: binary-git-backup-linux-x64
68+
path: linux/amd64/git-backup
69+
- uses: actions/download-artifact@v2
70+
with:
71+
name: binary-git-backup-linux-armv7
72+
path: linux/arm/v7/git-backup
73+
- run: find linux
74+
- uses: docker/setup-qemu-action@v1
75+
- uses: docker/setup-buildx-action@v1
76+
- uses: docker/login-action@v1
77+
with:
78+
registry: ghcr.io
79+
username: ${{ github.repository_owner }}
80+
password: ${{ secrets.GITHUB_TOKEN }}
81+
- name: Docker meta
82+
id: meta
83+
uses: docker/metadata-action@v3
84+
with:
85+
images: ghcr.io/chappio/git-backup
86+
tags: |
87+
type=ref,event=pr
88+
type=semver,pattern={{version}}
89+
type=semver,pattern={{major}}.{{minor}}
90+
type=semver,pattern={{major}}
91+
type=edge,branch=main
92+
- uses: docker/build-push-action@v2
93+
with:
94+
context: .
95+
platforms: linux/amd64,linux/arm/v7
96+
push: true
97+
tags: ${{ steps.meta.outputs.tags }}
98+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM alpine:3
2+
3+
ARG TARGETPLATFORM
4+
5+
RUN apk add --no-cache libc6-compat
6+
7+
ADD ${TARGETPLATFORM}/git-backup /
8+
RUN chmod +x /git-backup
9+
10+
VOLUME /backups
11+
12+
ENTRYPOINT ["/git-backup", "-backup.path", "/backups", "-config.file", "/backups/git-backup.yml"]

0 commit comments

Comments
 (0)