Skip to content

Commit

Permalink
actions: custom pages action
Browse files Browse the repository at this point in the history
the "deploy from a branch" option made 159 deployments, approximately 158 of which were unnecessary
  • Loading branch information
ThisAMJ committed Aug 29, 2024
1 parent 162947d commit f05f5b6
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 17 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/Pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Pages

on:
push:
branches: [ "master" ]
paths:
- 'docs/web/**'
workflow_dispatch:

jobs:
build:
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/web

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div align="center">

[![SourceAutoRecord Homepage](docs/img/sar_logo.webp)](https://sar.portal2.sr/)
[![SourceAutoRecord Homepage](docs/web/img/sar_logo.webp)](https://sar.portal2.sr/)

</div>

Expand Down
16 changes: 10 additions & 6 deletions SourceAutoRecord.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{2234E52A-D21C-4984-B830-0D1EBC6842C5}"
ProjectSection(SolutionItems) = preProject
docs\CNAME = docs\CNAME
docs\contributing.md = docs\contributing.md
docs\cvars.md = docs\cvars.md
docs\D-DIN.otf = docs\D-DIN.otf
docs\features.md = docs\features.md
docs\index.html = docs\index.html
docs\p2tas.md = docs\p2tas.md
docs\style.css = docs\style.css
docs\tas_proto.txt = docs\tas_proto.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "web", "web", "{C8813A51-4582-4546-8FD3-7E39FBB21FC6}"
ProjectSection(SolutionItems) = preProject
docs\web\D-DIN.otf = docs\web\D-DIN.otf
docs\web\index.html = docs\web\index.html
docs\web\style.css = docs\web\style.css
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{B82DAA33-1051-496B-A05A-58BB70E8BC02}"
ProjectSection(SolutionItems) = preProject
docs\img\sar_logo.webp = docs\img\sar_logo.webp
docs\web\img\sar_logo.webp = docs\web\img\sar_logo.webp
EndProjectSection
EndProject
Global
Expand All @@ -59,7 +62,8 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2234E52A-D21C-4984-B830-0D1EBC6842C5} = {4990948C-3306-40BA-9EAD-594A5520043F}
{B82DAA33-1051-496B-A05A-58BB70E8BC02} = {2234E52A-D21C-4984-B830-0D1EBC6842C5}
{C8813A51-4582-4546-8FD3-7E39FBB21FC6} = {2234E52A-D21C-4984-B830-0D1EBC6842C5}
{B82DAA33-1051-496B-A05A-58BB70E8BC02} = {C8813A51-4582-4546-8FD3-7E39FBB21FC6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FE1A6506-7258-47FF-839A-FF441AAA310C}
Expand Down
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

File renamed without changes.
File renamed without changes.
20 changes: 11 additions & 9 deletions docs/index.html → docs/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SourceAutoRecord</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" type="image/png" href="https://avatars.githubusercontent.com/u/83299896">
</head>
<body>
<nav>
Expand All @@ -21,11 +22,11 @@ <h1>SourceAutoRecord</h1>
<img src="img/sar_logo.webp" alt="SAR Banner" id="sar-banner">

<div id="badges">
<a href="https://github.com/p2sr/SourceAutoRecord/actions?query=workflow%3ACI+branch%3Amaster"><img src="https://github.com/p2sr/SourceAutoRecord/workflows/CI/badge.svg" alt="CI"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/actions?query=workflow%3ACD+branch%3Amaster"><img src="https://github.com/p2sr/SourceAutoRecord/workflows/CD/badge.svg" alt="CD"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/releases/latest"><img src="https://img.shields.io/github/v/release/p2sr/SourceAutoRecord?label=latest%20release" alt="Latest release"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/releases"><img src="https://img.shields.io/github/v/release/p2sr/SourceAutoRecord?label=latest%20pre-release&include_prereleases" alt="Latest pre-release"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/blob/master/LICENSE"><img src="https://img.shields.io/github/license/p2sr/SourceAutoRecord" alt="License"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/actions?query=workflow%3ACI+branch%3Amaster" target="_blank"><img src="https://github.com/p2sr/SourceAutoRecord/workflows/CI/badge.svg" alt="CI"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/actions?query=workflow%3ACD+branch%3Amaster" target="_blank"><img src="https://github.com/p2sr/SourceAutoRecord/workflows/CD/badge.svg" alt="CD"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/releases/latest" target="_blank"><img src="https://img.shields.io/github/v/release/p2sr/SourceAutoRecord?label=latest%20release" alt="Latest release"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/releases" target="_blank"><img src="https://img.shields.io/github/v/release/p2sr/SourceAutoRecord?label=latest%20pre-release&include_prereleases" alt="Latest pre-release"></a>
<a href="https://github.com/p2sr/SourceAutoRecord/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/github/license/p2sr/SourceAutoRecord" alt="License"></a>
</div>

<h1>Overview</h1>
Expand Down Expand Up @@ -107,7 +108,7 @@ <h1 id="installation">Installation</h1>
<br><br>
<p>NOTE: Submitting a run on an older version of SAR is against the rules, and will get your run removed from
the leaderboards. It is recommended to be on the latest version of SAR unless stated otherwise in the community
<a href="https://discord.gg/p2sr">Discord server</a>.</p>
<a href="https://discord.gg/hRwE4Zr" target="_blank">Discord server</a>.</p>

<hr class="horizontal">
<h1 id="support">Game support</h1>
Expand Down Expand Up @@ -147,9 +148,9 @@ <h1 id="support">Game support</h1>
<hr class="horizontal">
<h1 id="documentation">Documentation</h1>
<ul>
<li><a href="https://github.com/p2sr/SourceAutoRecord/blob/master/docs/contributing.md">Contributing</a></li>
<li><a href="https://github.com/p2sr/SourceAutoRecord/blob/master/docs/cvars.md">Console Commands & Variables</a></li>
<li><a href="https://wiki.portal2.sr/SAR">Setup & Usage</a></li>
<li><a href="https://github.com/p2sr/SourceAutoRecord/blob/master/docs/contributing.md" target="_blank">Contributing</a></li>
<li><a href="https://github.com/p2sr/SourceAutoRecord/blob/master/docs/cvars.md" target="_blank">Console Commands & Variables</a></li>
<li><a href="https://wiki.portal2.sr/SAR" target="_blank">Setup & Usage</a></li>
</ul>
</main>

Expand All @@ -166,6 +167,7 @@ <h1 id="documentation">Documentation</h1>
// See: https://developer.mozilla.org/en-US/docs/web/api/navigator/platform
if (window.navigator.platform.toLowerCase().includes("win"))
{
// TODO: Windows PDB download (assets[1])
document.querySelector("#download").innerHTML = `
<h3>Downloads for Windows:</h3>
<a href="${stable.assets[0].browser_download_url}" class="stable">Latest release (${stable.name})</a>
Expand Down
3 changes: 3 additions & 0 deletions docs/style.css → docs/web/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ main
background: var(--foreground);
border-radius: 6px;
padding: .5rem 1rem;
line-height: 2.5rem;
white-space: nowrap;
}

.stable
Expand All @@ -128,6 +130,7 @@ main
{
background: transparent !important;
display: block;
line-height: inherit !important;
}

/* 4.1 Links */
Expand Down

0 comments on commit f05f5b6

Please sign in to comment.