mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 16:40:58 -05:00
Merge pull request #222 from brecert/actions-demo
This commit is contained in:
commit
d09de028b3
4 changed files with 87 additions and 1 deletions
37
.github/workflows/preview_cleanup.yml
vendored
Normal file
37
.github/workflows/preview_cleanup.yml
vendored
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
name: Clean Preview
|
||||||
|
|
||||||
|
#! Safety:
|
||||||
|
#! this workflow should not execute any code at all
|
||||||
|
#! see githubs docs on pull_request_target for more
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [unlabeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clean:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event.label.name == 'use-preview'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: build-previews
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: clean previews
|
||||||
|
run: 'rm -rf "./refs/pull/${{ github.event.pull_request.number }}"'
|
||||||
|
|
||||||
|
- name: publish cleaned previews
|
||||||
|
uses: JamesIves/github-pages-deploy-action@4.1.5
|
||||||
|
with:
|
||||||
|
folder: .
|
||||||
|
branch: build-previews
|
||||||
|
single-commit: true
|
||||||
|
|
||||||
|
- name: send comment
|
||||||
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
|
with:
|
||||||
|
header: Preview environment
|
||||||
|
message: |
|
||||||
|
## Preview environment
|
||||||
|
There is no longer a preview enviroment for this pull request due to the `use-preview` label being removed
|
48
.github/workflows/preview_pull_request.yml
vendored
Normal file
48
.github/workflows/preview_pull_request.yml
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
name: Preview Pull Request
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [synchronize, reopened, labeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# make sure the pull request is labeled with 'use-preview'
|
||||||
|
if: github.event.label.name == 'use-preview' || contains(github.event.pull_request.labels.*.name, 'use-preview')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
# Head commit of the pull request
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 15
|
||||||
|
cache: "yarn"
|
||||||
|
|
||||||
|
- run: yarn install
|
||||||
|
# - run: yarn check
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: yarn build --base "/revite/${{ github.ref }}/"
|
||||||
|
|
||||||
|
- name: publish preview
|
||||||
|
uses: JamesIves/github-pages-deploy-action@4.1.5
|
||||||
|
with:
|
||||||
|
folder: dist
|
||||||
|
branch: build-previews
|
||||||
|
target-folder: ${{ github.ref }}
|
||||||
|
single-commit: true
|
||||||
|
|
||||||
|
- name: send comment
|
||||||
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
|
with:
|
||||||
|
header: Preview environment
|
||||||
|
message: |
|
||||||
|
## Preview environment
|
||||||
|
https://${{ github.repository_owner }}.github.io/revite/${{ github.ref }}/
|
||||||
|
|
||||||
|
This link will remain active until the `use-preview` label is removed.
|
|
@ -11,7 +11,7 @@ import Client from "./revoltjs/RevoltClient";
|
||||||
|
|
||||||
export default function Context({ children }: { children: Children }) {
|
export default function Context({ children }: { children: Children }) {
|
||||||
return (
|
return (
|
||||||
<Router>
|
<Router basename={import.meta.env.BASE_URL}>
|
||||||
<State>
|
<State>
|
||||||
<Theme>
|
<Theme>
|
||||||
<Settings>
|
<Settings>
|
||||||
|
|
1
src/env.d.ts
vendored
1
src/env.d.ts
vendored
|
@ -2,6 +2,7 @@ interface ImportMetaEnv {
|
||||||
DEV: boolean;
|
DEV: boolean;
|
||||||
VITE_API_URL: string;
|
VITE_API_URL: string;
|
||||||
VITE_THEMES_URL: string;
|
VITE_THEMES_URL: string;
|
||||||
|
BASE_URL: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
|
|
Loading…
Reference in a new issue