diff --git a/.github/workflows/master_polyglot.yml b/.github/workflows/master_polyglot.yml new file mode 100644 index 0000000..bf0fb68 --- /dev/null +++ b/.github/workflows/master_polyglot.yml @@ -0,0 +1,65 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy ASP.Net Core app to Azure Web App - polyglot + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: dotnet publish + run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp" + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: .net-app + path: ${{env.DOTNET_ROOT}}/myapp + + deploy: + runs-on: windows-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: .net-app + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_4C41E5C09E3B4A4BB060ACF319980094 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_4F39FCA24D1E4D319D0F663F47DCA3A8 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_D5DF8CE084B342AE98AAD1379F567455 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'polyglot' + slot-name: 'Production' + package: . + \ No newline at end of file diff --git a/README.md b/README.md index 0a567a2..129558d 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,22 @@ A simple Blazor app which converts libraries of saved links between the native formats of various read-it-later services. Currently supports [GoodLinks](https://goodlinks.app/), [Instapaper](https://www.instapaper.com/), [Omnivore](https://omnivore.app/), [Raindrop.io](https://raindrop.io/), and [Readwise Reader](https://readwise.io/read). -## General Usage +## Instructions ### Web App The app is [publically available](https://polyglot-hqbpg6f7hwdsgphd.eastus2-01.azurewebsites.net/), however it is hosted on a free plan with limited resources so availability is not guaranteed. -### Docker +### Local Installation -Ensure you have Docker installed and running on your system, then clone into the repo and build the app by running `docker build -t polyglot .`, then start the app by running `docker run -p 8080:8080 polyglot`. You can then access the app by navigating to `http://localhost:8080` in your browser. +#### Docker +Ensure you have Docker installed and running on your system, then clone into the repo and first build the app by running `docker build . -t polyglot`, then start the app by running `docker run -p 8080:8080 polyglot`. Finally, navigate to `http://localhost:8080` in your browser. -### .NET SDK +#### Native +If you wish to build the app natively rather than using Docker, ensure that the latest [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download) is installed on the host system, then clone into the repo and execute `dotnet run --project Polyglot` from the project directory. Navigate to the URL indicated in the `dotnet run` command output. -Ensure that the latest .NET 8 SDK is installed on the host system, then clone into the repo and execute `dotnet run --project Polyglot` from the project directory. Navigate to the URL indicated in the `dotnet run` command output, and you will be presented with a simple interface allowing you to choose the input format (i.e. your current read-it-later service), the output format (i.e. the read-it-later service you wish to import your library into), and finally the input file itself. After uploading your input file, the exported result of the format conversion process will immediately be available in the default download directory of your current browser. +### Usage +After navigating to the local URL, you will be presented with a simple interface allowing you to choose the input format (i.e. your current read-it-later service), the output format (i.e. the read-it-later service you wish to import your library into), and finally the input file itself. After uploading your input file, the exported result of the format conversion process will immediately be available in the default download directory of your current browser. **Please be aware that each read-it-later service has its own particular limitations**. These are detailed below, along with instructions on how to properly import the file provided by this app.