File tree Expand file tree Collapse file tree 4 files changed +43
-3
lines changed
service/backup/assets/tool Expand file tree Collapse file tree 4 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -7,3 +7,8 @@ BACKUP_CRON_EXP: 0 4 * * *
77
88# Delete backups that are over 15 days
99BACKUP_TTL : 15
10+
11+ # Owner Info
12+ BACKUP_FILE_OWNER_ID : 0
13+ BACKUP_FILE_GROUP_ID : 0
14+ BACKUP_FILE_PERMISSIONS : 600
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ dateFileFormat="+%Y%m%dT%H%M%S"
1212backupFilePath=" $BACKUP_OUTPUT /$( date " $dateFileFormat " ) .tar.gz"
1313
1414tar -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
1718exit 0
You can’t perform that action at this time.
0 commit comments