test cross deps #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish Plugins and Themes | |
on: | |
push: | |
paths: | |
- Plugins/** | |
- Themes/** | |
- .github/** | |
pull_request: | |
paths: | |
- Plugins/** | |
- Themes/** | |
- .github/** | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
build_and_publish: | |
name: Build plugins and themes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install repository dependencies | |
run: npm ci | |
- name: Build themes | |
run: | | |
npm run build-theme | |
cp -r Themes/PlexBetterStyles/PlexBetterStyles.yml dist/Themes/PlexBetterStyles/ | |
- name: Copy plugins | |
run: | | |
cp -r Plugins dist/Plugins/ | |
rm -rf dist/Plugins/HotReload | |
- name: Copy build.sh | |
run: cp -r .github/workflows/build.sh dist/ | |
- name: Publish to dist branch | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: dist | |
FOLDER: "dist" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
name: Run build.sh | |
runs-on: ubuntu-latest | |
needs: build_and_publish | |
steps: | |
- name: Checkout dist | |
uses: actions/checkout@v3 | |
with: | |
path: dist | |
ref: dist | |
fetch-depth: "0" | |
# Run "git update-index --chmod=+x build.sh" and commit changes to grant elevated permissions so build.sh runs without any errors | |
- run: | | |
cd dist | |
./build.sh ../_site/release | |
- uses: actions/upload-pages-artifact@v2 | |
deploy: | |
name: Publish plugins and themes | |
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 |