Skip to content

Commit e839482

Browse files
committed
added default docker-compose and switched build to tag based multiarch
1 parent 126f804 commit e839482

File tree

2 files changed

+81
-15
lines changed

2 files changed

+81
-15
lines changed

.github/workflows/build-docker.yml

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,59 @@
1-
name: Publish Docker image
1+
name: ci
2+
23
on:
3-
release:
4-
types: [published]
54
push:
6-
branches: [ master ]
5+
tags:
6+
- "v*.*.*"
77
pull_request:
8-
branches: [ master ]
8+
branches:
9+
- "master"
10+
911
jobs:
10-
push_to_registry:
11-
name: Push Docker image to Docker Hub
12+
docker:
1213
runs-on: ubuntu-latest
13-
1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: Login to DockerHub Registry
17-
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
18-
- name: Build the Docker image
19-
run: docker build . --file docker/Dockerfile --tag hascheksolutions/backupdrop:$(date +%s) --tag hascheksolutions/backupdrop:latest
20-
- name: Push the Docker image to the registry
21-
run: docker push hascheksolutions/backupdrop
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Docker meta
18+
id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
# list of Docker images to use as base name for tags
22+
images: |
23+
hascheksolutions/backupdrop
24+
ghcr.io/hascheksolutions/backupdrop
25+
# generate Docker tags based on the following events/attributes
26+
tags: |
27+
type=schedule
28+
type=ref,event=branch
29+
type=ref,event=pr
30+
type=semver,pattern={{version}}
31+
type=semver,pattern={{major}}.{{minor}}
32+
type=semver,pattern={{major}}
33+
type=sha
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
- name: Login to Docker Hub
39+
if: github.event_name != 'pull_request'
40+
uses: docker/login-action@v3
41+
with:
42+
username: ${{ secrets.DOCKER_USERNAME }}
43+
password: ${{ secrets.DOCKER_PASSWORD }}
44+
- name: Login to GHCR
45+
if: github.event_name != 'pull_request'
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.repository_owner }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
- name: Build and push
52+
uses: docker/build-push-action@v5
53+
with:
54+
context: .
55+
file: docker/Dockerfile
56+
platforms: linux/amd64,linux/arm/v7,linux/arm64
57+
push: ${{ github.event_name != 'pull_request' }}
58+
tags: ${{ steps.meta.outputs.tags }}
59+
labels: ${{ steps.meta.outputs.labels }}

docker-compose.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: '3.8'
2+
3+
services:
4+
backupdrop:
5+
image: hascheksolutions/backupdrop
6+
ports:
7+
- "8080:80"
8+
environment:
9+
# remove unneeded config options
10+
- ENCRYPTION_AGE_SSH_PUBKEY=
11+
- ENCRYPTION_AGE_PUBKEY=
12+
- S3_BUCKET=
13+
- S3_ACCESS_KEY=
14+
- S3_SECRET_KEY=
15+
- S3_ENDPOINT=
16+
- KEEP_N_BACKUPS=
17+
- KEEP_N_DAYS=
18+
- KEEP_N_GIGABYTES=
19+
- FTP_SSL=
20+
- FTP_SERVER=
21+
- FTP_PORT=
22+
- FTP_USER=
23+
- FTP_PASS=
24+
- FTP_BASEDIR=
25+
restart: unless-stopped
26+
volumes:
27+
- ./data:/var/www/backupdrop/data
28+

0 commit comments

Comments
 (0)