diff --git a/.github/workflows/deploy.ghcr.yml b/.github/workflows/deploy.ghcr.yml index c9e4e19..547be91 100644 --- a/.github/workflows/deploy.ghcr.yml +++ b/.github/workflows/deploy.ghcr.yml @@ -5,6 +5,10 @@ on: tags: - 'ghcr-*' +env: + REGISTRY: ghcr.io + IMAGE_NAME: ghcr.io/${{ github.repository }} + jobs: push_to_registries: name: Push Docker image to multiple registries @@ -19,7 +23,7 @@ jobs: - name: Log in to the Container registry uses: docker/login-action@v3 with: - registry: ghcr.io + registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -27,7 +31,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ghcr.io/${{ github.repository }} + images: ${{ env.IMAGE_NAME }} - name: Build and push Docker images uses: docker/build-push-action@v5 @@ -35,5 +39,5 @@ jobs: context: ./web file: ./web/Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/deploy.private.yml b/.github/workflows/deploy.private.yml index 3b0bc45..1b9bf41 100644 --- a/.github/workflows/deploy.private.yml +++ b/.github/workflows/deploy.private.yml @@ -5,6 +5,10 @@ on: tags: - 'private-*' +env: + REGISTRY: ${{ secrets.DOCKER_REGISTRY }} + IMAGE_NAME: ${{ secrets.DOCKER_REGISTRY }}/${{ github.repository }} + jobs: deployment: runs-on: ubuntu-22.04 @@ -22,7 +26,7 @@ jobs: - name: Ping Tailscale run: | - curl ${{ secrets.DOCKER_REGISTRY }} + curl ${{ env.REGISTRY }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -32,7 +36,7 @@ jobs: with: driver-opts: network=host config-inline: | - [registry."${{ secrets.DOCKER_REGISTRY }}"] + [registry."${{ env.REGISTRY }}"] http = true insecure = true - @@ -42,10 +46,10 @@ jobs: context: ./web file: ./web/Dockerfile push: true - tags: ${{ secrets.DOCKER_REGISTRY }}/rss-bookmarkr:latest + tags: ${{ env.IMAGE_NAME }}:latest labels: | com.centurylinklabs.watchtower.enable=true - name: Inspect run: | - docker buildx imagetools inspect ${{ secrets.DOCKER_REGISTRY }}/rss-bookmarkr:latest \ No newline at end of file + docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:latest \ No newline at end of file diff --git a/web/docker-compose.registry.private.yaml b/web/docker-compose.registry.private.yaml index 66ffbcf..4596d19 100644 --- a/web/docker-compose.registry.private.yaml +++ b/web/docker-compose.registry.private.yaml @@ -1,6 +1,6 @@ services: web: - image: localhost:5000/rss-bookmarkr + image: localhost:5000/rss-bookmarkr:latest container_name: rss-bookmarkr restart: unless-stopped network_mode: "host"