Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs workflow #58

Merged
merged 3 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release
on:
push:
branches:
- main
- master
workflow_dispatch:

jobs:
Expand All @@ -22,10 +22,6 @@ jobs:
- name: Install dependencies
run: yarn install

- name: Check if TypeScript files changed
id: check-changes
run: echo ::set-output name=changed::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '\.ts$' | wc -l)

- name: Get latest tag
id: get-latest-tag
run: echo ::set-output name=latest_tag::$(git describe --tags --abbrev=0 | sed 's/^v//')
Expand All @@ -40,7 +36,7 @@ jobs:

- name: Check if semver label is valid
id: check-semver
if: steps.check-changes.outputs.changed == 'true'
if: steps.check-version.outputs.is_higher == 'true'
run: |
const labelsInput = ${{ toJSON(github.event.pull_request.labels) }};
const currentVersion = ${{ steps.get-version.outputs.version }};
Expand All @@ -62,11 +58,11 @@ jobs:
echo ::set-output name=is_valid::$(isSemverValid)

- name: Build project
if: steps.check-changes.outputs.changed == 'true' && steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true'
if: && steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true'
run: yarn run build

- name: 🛎️ Create release
if: steps.check-changes.outputs.changed == 'true' && steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true'
if: steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true'
uses: softprops/action-gh-release@v1
with:
files: dist/sunsynk-power-flow-card.js
Expand All @@ -76,5 +72,5 @@ jobs:
generate_release_notes: true

- name: 🏷️ Update latest tag
if: steps.check-changes.outputs.changed == 'true' && steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true'
if: steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true'
uses: EndBug/latest-tag@latest
11 changes: 0 additions & 11 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Check for relevant changes
id: check-changes
run: |
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E "^(readme\.md|docs\/)")
if [ -z "$changed_files" ]; then
echo "No relevant changes. Exiting..."
exit 0
fi
echo "::set-output name=changed_files::$changed_files"

- name: Deploy to GitHub Pages
if: steps.check-changes.outputs.changed_files != ''
uses: totaldebug/sphinx-publish-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
Loading