obsidian-webpage-export icon indicating copy to clipboard operation
obsidian-webpage-export copied to clipboard

Create Docker container to Publish publish notes automatically

Open spartacus04 opened this issue 9 months ago • 9 comments

Goals

  • [x] Create a docker container that automatically builds the files headlessly
  • [x] Allow container to export with last settings
  • [x] Allow container to export with custom settings
  • [x] Setup a github action to use the container
  • [x] Compatibility with future versions without publishing of container

What I did so far

  • Updated all dependencies
  • Created a Docker container that builds the plugin and exports the vault with latest files (supports mounting a custom config file)
  • Tweaked the plugin to allow this
  • Tweak publish github actions to build the Docker container and publish it to DockerHub (Need to setup DOCKER_USERNAME and DOCKER_TOKEN inside repository secrets)
  • Created a github action to allow automation of publishing

Related to

#49 #140

spartacus04 avatar May 10 '24 12:05 spartacus04

Almost ready, the docker container is exporting to HTML successfully, just need to finish the github action and test it a bit, then it'll be ready to be merged.

spartacus04 avatar May 13 '24 21:05 spartacus04

Amazing! Thank you so much for your work on this!

KosmosisDire avatar May 13 '24 21:05 KosmosisDire

Just finished this, just remember to setup the DOCKER_USERNAME and DOCKER_TOKEN secrets inside the repository settings. Once a new tag is published the github action will start working correctly.

Here's an example on how the github action works:

      - name: Obsidian Webpage Export Action
        id: obsidian-webpage-export
        uses: KosmosisDire/obsidian-webpage-export
        with:
          vault: ./ #defaults to .
          version: latest #optional
          config: config.json #optional

      - run: |
          echo "The export is available at ${{ steps.obsidian-webpage-export.outputs.output }}"

I would advise creating a new tag both for the stable and beta release.

spartacus04 avatar May 23 '24 08:05 spartacus04

Awesome, this is amazing. I am pretty busy atm but I'll try and take a look at getting this set up today

KosmosisDire avatar May 24 '24 15:05 KosmosisDire

Hey, I am trying to test this outside of GitHub actions and it seems to all work but I can't get it to actually export specific files. I think the config.json is not being respected somehow, I assume the config.json is meant to be the settings (data.json) from the plugin. When I export I simply get an export as if no files were selected for export. I just get the lib folder and no .html files. Is the config.json being copied into the plugin directory correctly?

KosmosisDire avatar May 30 '24 17:05 KosmosisDire

Hey, sorry for the late response. I was pretty busy last week. I just pushed a fix to that.

I also remembered, I haven't tested this for the 1.8.1 version, just for the master branch. Since I made some changes to the plugin code itself, for it to work they must also be applied to the other branches.

spartacus04 avatar Jun 09 '24 12:06 spartacus04

Thanks I'll test it out again, as far as the other branches I can either copy over the changes or they will be applied when the branch is merged into master.

KosmosisDire avatar Jun 09 '24 15:06 KosmosisDire

Just popping in to say that I haven't forgotten about this PR, but I have been pretty busy. I will likely try to integrate it with the next beta release :)

KosmosisDire avatar Jul 25 '24 04:07 KosmosisDire

No worries! I'm pretty busy myself so I understand lol

spartacus04 avatar Jul 25 '24 08:07 spartacus04

Hey there, I'm just writing to say that this PR isn't working with 1.9.0-1b. It would probably work if the exportObsidian method was implemented, since right now for versions that do not implement it I'm using a hacky fallback method to make it work.

In the next few weeks I'll start working on a fix, and if you need to I can make a new PR for the beta version. That way it could be implemented more easily.

spartacus04 avatar Aug 26 '24 14:08 spartacus04

I can probably just copy that function over, it was a really simple function if I remember correctly

KosmosisDire avatar Aug 26 '24 16:08 KosmosisDire

Yeah, it's really easy. I just had to edit some bits of the export methods to allow overriding the export path.

spartacus04 avatar Aug 27 '24 16:08 spartacus04

Hi there, I just implemented the exportDocker in the latest 1.9.0 branch and it works completely fine. I'm making a PR right now with those changes for that branch. (#500 )

spartacus04 avatar Sep 10 '24 18:09 spartacus04

Thank you!

KosmosisDire avatar Sep 11 '24 15:09 KosmosisDire

I will go head and pull this in now :)

KosmosisDire avatar Sep 17 '24 18:09 KosmosisDire