Skip to content

Commit 0888022

Browse files
committed
CI: use env variables for repo name / owner
1 parent 8eccc16 commit 0888022

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GITHUB_REPOSITORY_OWNER=plowsof

.github/workflows/build-docker.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343

4444
- name: transmission-show (pull or build)
4545
run: |
46-
tag_name="ghcr.io/plowsof/monero-torrent-show:latest"
46+
tag_name="ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-torrent-show:latest"
4747
case "${{ steps.changes.outputs.transmission }}" in
4848
true)
4949
docker build -f ./.github/workflows/docker/Dockerfile.transmission -t $tag_name .
50-
docker push -a ghcr.io/plowsof/monero-torrent-show
50+
docker push -a ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-torrent-show
5151
;;
5252
*)
5353
docker pull "$tag_name" || docker build -f ./.github/workflows/docker/Dockerfile.transmission -t "$tag_name" .
@@ -109,16 +109,16 @@ jobs:
109109
INFOHASH="${INFOHASH%%&*}"
110110
INFOHASH_GUI="${MAGNET_LINK_GUI#*btih:}"
111111
INFOHASH_GUI="${INFOHASH_GUI%%&*}"
112-
TORRENT_URL="https://github.com/plowsof/monero-torrent/releases/download/${GITHUB_REF_NAME}/monero-${VERSION}.torrent"
113-
TORRENT_URL_GUI="https://github.com/plowsof/monero-torrent/releases/download/${GITHUB_REF_NAME}/monero-gui-${VERSION_GUI}.torrent"
112+
TORRENT_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${GITHUB_REF_NAME}/monero-${VERSION}.torrent"
113+
TORRENT_URL_GUI="https://github.com/${GITHUB_REPOSITORY}/releases/download/${GITHUB_REF_NAME}/monero-gui-${VERSION_GUI}.torrent"
114114
echo "INFOHASH=$INFOHASH" >> $GITHUB_ENV
115115
echo "INFOHASH_GUI=$INFOHASH_GUI" >> $GITHUB_ENV
116116
echo "TORRENT_URL=$TORRENT_URL" >> $GITHUB_ENV
117117
echo "TORRENT_URL_GUI=$TORRENT_URL_GUI" >> $GITHUB_ENV
118118
119119
- name: Push new image to ghcr
120120
if: github.ref_type == 'tag' || ( steps.changes.outputs.src == 'true' && github.ref == 'refs/heads/main' )
121-
run: docker push -a ghcr.io/plowsof/monero-torrent-build-env
121+
run: docker push -a ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-torrent-build-env
122122

123123
- if: ${{ steps.binaries_cache.outputs.cache-hit != 'true' }}
124124
name: Compare hashes for local/remote build and write summary

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
monero-torrent-remote:
3-
image: ghcr.io/plowsof/monero-torrent-build-env:latest
3+
image: ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-torrent-build-env:latest
44
build:
55
context: .
66
environment:
@@ -17,7 +17,7 @@ services:
1717
profiles: ["remote"]
1818

1919
monero-torrent-local:
20-
image: ghcr.io/plowsof/monero-torrent-build-env:latest
20+
image: ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-torrent-build-env:latest
2121
build:
2222
context: .
2323
environment:

0 commit comments

Comments
 (0)