Skip to content

Commit 1773b89

Browse files
authored
Merge pull request #1 from Freeesia/feature/owner
Feature/owner
2 parents 58448f7 + ed00816 commit 1773b89

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/owner
7+
8+
jobs:
9+
build_and_push:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: docker/setup-buildx-action@v2
17+
- run: |
18+
IMAGE_ID=freeesia/backup
19+
IMAGE_ID=${IMAGE_ID,,}
20+
echo "image_tag=$IMAGE_ID" >> $GITHUB_ENV
21+
- uses: docker/login-action@v2
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- uses: docker/build-push-action@v4
28+
with:
29+
context: image
30+
build-args: |
31+
Repository=${{ github.repository }}
32+
labels: |
33+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
34+
push: true
35+
tags: ghcr.io/${{ env.image_tag }}:${{ github.sha }},ghcr.io/${{ env.image_tag }}:dev

image/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Use osixia/light-baseimage
22
# sources: https://github.com/osixia/docker-light-baseimage
3-
FROM osixia/light-baseimage:1.1.1
4-
MAINTAINER Bertrand Gouny <bertrand.gouny@osixia.net>
3+
FROM osixia/light-baseimage
54

65
# Install Backup Manager, GNUPG for encryption and cron from baseimage
76
# sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available

image/environment/default.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ BACKUP_CRON_EXP: 0 4 * * *
77

88
# Delete backups that are over 15 days
99
BACKUP_TTL: 15
10+
11+
# Owner Info
12+
BACKUP_FILE_OWNER_ID: 0
13+
BACKUP_FILE_GROUP_ID: 0
14+
BACKUP_FILE_PERMISSIONS: 600

image/service/backup/assets/tool/backup

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dateFileFormat="+%Y%m%dT%H%M%S"
1212
backupFilePath="$BACKUP_OUTPUT/$(date "$dateFileFormat").tar.gz"
1313

1414
tar -czf $backupFilePath $BACKUP_INPUT
15-
chmod 600 $backupFilePath
15+
chmod $BACKUP_FILE_PERMISSIONS $backupFilePath
16+
chown $BACKUP_FILE_OWNER_ID:$BACKUP_FILE_GROUP_ID $backupFilePath
1617

1718
exit 0

0 commit comments

Comments
 (0)