Skip to content

Commit

Permalink
Create custom Pages workflow for download link
Browse files Browse the repository at this point in the history
  • Loading branch information
wheelercj committed Nov 14, 2024
1 parent 4dc4c48 commit 66edf99
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 18 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and deploy documentation on GitHub Pages

on: [push]

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add zip file download links to the installation instructions
run: |
RELEASE_TAG=$(git describe --tags --abbrev=0 --match=v*.*.*)
echo $RELEASE_TAG
URL="https://github.com/Stardown-app/Stardown/releases/download/${RELEASE_TAG}/stardown-${RELEASE_TAG}"
echo $URL
cat docs/install-and-update-instructions/script.js \
| sed s,\<a\ class=\"firefox\",\<a\ href=\"$URL-firefox.zip\", \
| sed s,\<a\ class=\"chrome\",\<a\ href=\"$URL-chrome.zip\", \
| tee docs/install-and-update-instructions/script.js >/dev/null
- name: Set up GitHub Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
deploy:
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and release .zip files
name: Build and release zip files

# [softprops/action-gh-release: GitHub Action for creating GitHub Releases](https://github.com/softprops/action-gh-release)
# [GitHub Actions](https://github.com/actions)
Expand Down
10 changes: 5 additions & 5 deletions docs/install-and-update-instructions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ <h2>
If in a Chromium browser, select Stardown's <code>chrome</code> folder.
</li>
</ol>
<h2>Install with a .zip file</h2>
<h2>Install with a zip file</h2>
<ol>
<li>
<a href="https://github.com/Stardown-app/Stardown/releases/latest" target="_blank">
Download the .zip file</a> named after your browser
Download the zip file</a> named after your browser
</li>
<li>Unzip the .zip file</li>
<li>Unzip the zip file</li>
<li>
If in Firefox, select the <code>manifest.json</code> file.
If in a Chromium browser, select the folder.
Expand Down Expand Up @@ -130,7 +130,7 @@ <h2>Install with a .zip file</h2>
</li>
<li>
<input type="radio" id="installedWithZip" name="installedWith" value="installedWithZip" />
<label for="installedWithZip">with a .zip file</label>
<label for="installedWithZip">with a zip file</label>
</li>
<li>
<input type="radio" id="installedWithTerminal" name="installedWith" value="installedWithTerminal" />
Expand All @@ -149,7 +149,7 @@ <h2>Install with a .zip file</h2>
</li>
<li>
<input type="radio" id="willInstallWithZip" name="willInstallWith" value="willInstallWithZip" />
<label for="willInstallWithZip">with a .zip file</label>
<label for="willInstallWithZip">with a zip file</label>
</li>
<li>
<input type="radio" id="willInstallWithTerminal" name="willInstallWith" value="willInstallWithTerminal" />
Expand Down
20 changes: 8 additions & 12 deletions docs/install-and-update-instructions/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,17 @@ function installWithStore(instructions) {
function installWithZip(instructions) {
if (chromiumEl.checked) {
instructions.steps.push(
`<a href="https://github.com/Stardown-app/Stardown/releases/latest" target="_blank">
Download the chrome.zip file</a>`,
'Unzip the .zip file',
'<a class="chrome" target="_blank">Download the zip file</a>',
'Unzip the zip file',
'In your browser, open <code>chrome://extensions/</code>',
'Turn on developer mode',
'Click "Load unpacked"',
'Select the unzipped copy of Stardown',
);
} else if (firefoxEl.checked) {
instructions.steps.push(
`<a href="https://github.com/Stardown-app/Stardown/releases/latest" target="_blank">
Download the firefox.zip file</a>`,
'Unzip the .zip file',
'<a class="firefox" target="_blank">Download the zip file</a>',
'Unzip the zip file',
'In your browser, open <code>about:debugging#/runtime/this-firefox</code>',
'Click "Load Temporary Add-on..."',
'Select the manifest.json in the unzipped copy of Stardown',
Expand Down Expand Up @@ -247,19 +245,17 @@ function updateWithStore(instructions) {
function updateWithZip(instructions) {
if (chromiumEl.checked) {
instructions.steps.push(
`<a href="https://github.com/Stardown-app/Stardown/releases/latest" target="_blank">
Download a new chrome.zip file</a>`,
'Unzip the .zip file',
'<a class="chrome" target="_blank">Download a new zip file</a>',
'Unzip the zip file',
'In your browser, open <code>chrome://extensions/</code>',
'Remove Stardown',
'Click "Load unpacked"',
'Select the newly unzipped copy of Stardown',
);
} else if (firefoxEl.checked) {
instructions.steps.push(
`<a href="https://github.com/Stardown-app/Stardown/releases/latest" target="_blank">
Download a new firefox.zip file</a>`,
'Unzip the .zip file',
'<a class="firefox" target="_blank">Download a new zip file</a>',
'Unzip the zip file',
'In your browser, open <code>about:debugging#/runtime/this-firefox</code>',
'Remove Stardown',
'Click "Load Temporary Add-on..."',
Expand Down

0 comments on commit 66edf99

Please sign in to comment.