Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github workflow for Azure #216

Merged
merged 6 commits into from
Nov 1, 2021
Merged

Add github workflow for Azure #216

merged 6 commits into from
Nov 1, 2021

Conversation

mohit038-zz
Copy link
Contributor

fixes #215

@mohit038-zz
Copy link
Contributor Author

@tobiasdiez, Please change the index document name from the default index.html to taskpane.html in the Azure portal.

see the 6th point.
https://docs.microsoft.com/en-us/office/dev/add-ins/publish/publish-add-in-vs-code#using-visual-studio-code-to-publish

@tobiasdiez
Copy link
Member

In contrast to "Azure Storage" apps, "Static Web Apps" don't seem to have this option. I've found Azure/static-web-apps#232 which discusses the same issue and recommends to add an empty index.html. Could you please try this?

@tobiasdiez
Copy link
Member

But maybe it's already enough to change

filename: "taskpane.html",
to use index.html instead of taskpane.html, and change the reference in the manifest at the same time. Not sure if the entry pane has to be called taskpane.

@github-actions
Copy link

github-actions bot commented Nov 1, 2021

Azure Static Web Apps: Your stage site is ready! Visit it here: https://lively-ground-0d7c50410-216.centralus.azurestaticapps.net

@mohit038-zz mohit038-zz marked this pull request as ready for review November 1, 2021 14:31
@github-actions
Copy link

github-actions bot commented Nov 1, 2021

Azure Static Web Apps: Your stage site is ready! Visit it here: https://lively-ground-0d7c50410-216.centralus.azurestaticapps.net

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 1, 2021

Azure Static Web Apps: Your stage site is ready! Visit it here: https://lively-ground-0d7c50410-216.centralus.azurestaticapps.net

Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I just tried to follow https://docs.microsoft.com/en-us/office/dev/add-ins/testing/create-a-network-shared-folder-catalog-for-task-pane-and-content-add-ins to test if one could sideload the staged build in Word. However, the address in the manifest points to localhost and not to the (changing) azure staging address. Don't know what's the best way to fix this. The obvious choices of a) having a fixed staging web address or b) transforming the manifest during build to inject the correct address don't seem to be possible right now Azure/static-web-apps#22 Azure/static-web-apps#537.
What could work is to use the output of the deployment https://github.com/Azure/static-web-apps-deploy/blob/0407e359a606e89151694428fa2457e4ef646693/action.yml#L44, transform the manifest file and then do another deployment including the new manifest. Sounds very awkward. Anyway, that's something for a new PR.

@tobiasdiez tobiasdiez merged commit 9764423 into main Nov 1, 2021
@tobiasdiez tobiasdiez deleted the deployment-workflow branch November 1, 2021 19:03
@mohit038-zz
Copy link
Contributor Author

mohit038-zz commented Nov 2, 2021

Transform the manifest file and then do another deployment, including the new manifest

We don't need to host the manifest file on the server. This file just points to the location where the addin is hosted. And this shared catalog folder thing is like a shared google drive folder that can only be shared with Windows users. So my suggestion is to create a google drive folder and put the updated manifest file in that folder so that everyone can access it.

And another advantage of using a drive folder is that even if our staging web address changes, we can easily update the web address in the manifest file.

I just tried to follow https://docs.microsoft.com/en-us/office/dev/add-ins/testing/create-a-network-shared-folder-catalog-for-task-pane-and-content-add-ins to test if one could sideload the staged build in Word.

I tried it with the updated link, but I got an error because the addin is still not connected with jabref online. It should work after the API azure function is implemented.

Edit: Sorry, I didn't know that link changes every time a commit is pushed, I'd suggest we have a stable link in that case if that's possible.

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

k3KAW8Pnf7mkmdSMPHz27 commented Nov 27, 2021

Edit: Sorry, I didn't know that link changes every time a commit is pushed, I'd suggest we have a stable link in that case if that's possible.

I think it just changes for every PR. I'll keep on looking at option b,

b) transforming the manifest during build to inject the correct address

and here are some links for now 😛

@tobiasdiez
Copy link
Member

Ohh, I didn't realized that the URL is essentially constant except for the PR id. That's a super nice finding @k3KAW8Pnf7mkmdSMPHz27!

So in this case, the github action can indeed construct the correct path and inject it into the manifest file before uploading. Then one can simply test the PR by sideloading something like https://lively-ground-0d7c50410-216.centralus.azurestaticapps.net/manifest.xml

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

Perhaps updating the manifest can be done with https://github.com/marketplace/actions/edit-xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add github workflow to deploy to azure as static web app
3 participants