forked from Freetz/freetz
-
-
Notifications
You must be signed in to change notification settings - Fork 107
53 lines (43 loc) · 1.55 KB
/
image_dl-packs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: image_dl-packs
on:
push:
branches: [ master ]
paths:
- '.github/workflows/image_dl-packs.yml'
- '.github/docker/dl-packs/*'
schedule:
- cron: '45 18 28 * *'
workflow_dispatch:
jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
if: github.repository == 'freetz-ng/freetz-ng'
steps:
- name: checkout
uses: actions/checkout@v4
- name: prepare
id: prepare
run: |
OWNER="$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')"
[ -z "$OWNER" ] && OWNER="$(echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]')"
[ -n "$OWNER" ] && echo "owner=$OWNER" >> $GITHUB_OUTPUT || exit 1
IMAGE="$(echo "${{ github.workflow }}" | sed 's/.*_//')"
[ -n "$IMAGE" ] && echo "image=$IMAGE" >> $GITHUB_OUTPUT || exit 1
for x in Dockerfile entrypoint.sh; do ln -s .github/docker/$IMAGE/$x; done
echo "################################################################" && echo "URI=$OWNER/$IMAGE"
- name: login
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ steps.prepare.outputs.owner }}/${{ steps.prepare.outputs.image }}:latest