Skip to content

Commit

Permalink
fix: release pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: seven <[email protected]>
  • Loading branch information
Blankll committed Jan 24, 2024
1 parent c775925 commit 469b490
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/page-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,22 @@ jobs:
uses: actions/checkout@v4
- run: npm ci
- run: npm run docs:build
- name: Compare Versions
run: |
TAG_VERSION=$(echo ${{env.TAG}} | tr -dc '0-9')
PACKAGE_VERSION=$(echo ${{env.PACKAGE}} | tr -dc '0-9')
if (( $((10#$PACKAGE_VERSION + 1)) > $((10#$TAG_VERSION + 1)) )); then
echo "new version ready to release"
echo "RELEASE=true" >> "$GITHUB_ENV"
else
echo "no new version to release"
echo "RELEASE=false" >> "$GITHUB_ENV"
fi
- uses: neverendingqs/gh-action-tag-on-npm-version@master
if: env.RELEASE == 'true' && github.ref == 'refs/heads/master'
- name: Check if version has been updated
if: github.ref == 'refs/heads/master'
uses: EndBug/version-check@v2
id: check
- name: Create new tag against package.json version
uses: neverendingqs/gh-action-tag-on-npm-version@master
if: steps.check.outputs.has_changed == 'true'
- name: Build Release
uses: "marvinpinto/action-automatic-releases@latest"
if: env.RELEASE == 'true' && github.ref == 'refs/heads/master'
if: steps.check.outputs.has_changed == 'true'
with:
prerelease: false
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: |
dist/**/*
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
if: env.RELEASE == 'true' && github.ref == 'refs/heads/master'
if: steps.check.outputs.has_changed == 'true'
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Expand Down

0 comments on commit 469b490

Please sign in to comment.