How to use as part of GitHub actions? #790
Replies: 1 comment
|
For a client-side Leptos/Trunk app, build it in a preceding runner step, then upload only After checkout and installing your project’s Rust toolchain/Trunk version: - name: Build static site
run: |
rustup target add wasm32-unknown-unknown
trunk build --release
test -f dist/index.html
- name: Deploy static site
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WHITE_GROUND_0D7D34503 }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: dist
api_location: ""
output_location: ""
skip_app_build: trueThis uses your existing SWA deployment-token secret, so this route needs no separate CLI service-principal login or subscription selection. Rust’s build dependencies stay on the runner; they are not uploaded with Microsoft’s documented prebuilt-app configuration. This applies to a static/CSR build; a Leptos SSR server needs separate hosting. I haven’t run your project, so keep the toolchain and Trunk versions that work locally. |
Uh oh!
There was an error while loading. Please reload this page.
Hello all,
(Searched discussions for "actions", "workflow", ''yml")
I am hoping someone might be able to point me in the right direction here or enlighten me :)
I know there is a workflow file issued when setting up a SWA in Azure, however I have been playing with changing my Vue app to a Leptos app and I can get the app to deploy using the CLI (which is really good), however I am struggling to get the actions to work (I'm not too well versed with yml, however I think I'm struggling more due to a lack of deeper understanding of Azure).
I have tried using the stock yml file, but Oryx can't find the framework (which I expected), and then I realise I can't override the build command because it's not a node project. I also tried installing Trunk so I could build the app that way but the dependencies appear to make the file waaay too large. So I tried to run the CLI through a workflow file which I have been testing for quite some time and can't figure it out. I can get myself logged in automatically using the service principal flags and that's great, but I am met with an error that there is no subscription associated with the tenant-id (I am not sure how to link this to the SWA which I have created - again, some understanding is missing on my part I think?).
I realise this is possibly a little open ended, but I am trying to verse myself better with Azure and any help/guidance here would be greatly appreciated. I have the app running as I stated, but that was from manually running through the CLI which was very quick and easy.
This is my current
azure.ymlfile I am using, although I am not sure if it is of use or how far away I am exactly from achieving what I want:Cheers
Ryan :)
All reactions