Skip to content

Commit

Permalink
improve ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
simbo committed Dec 5, 2023
1 parent a862494 commit 33ec3ed
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Expand Up @@ -10,13 +10,15 @@ on:
branches:
- main

permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
ci:
runs-on: ubuntu-22.04

permissions:
contents: write
steps:
- name: πŸ›Ž Checkout
uses: actions/checkout@v4
Expand All @@ -40,27 +42,26 @@ jobs:
- name: πŸ‘·β€β™‚οΈ Build
run: npm run build

- name: πŸ“¦ Create Release Package
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
id: package
run: zip -r dist.zip dist

- name: πŸ“‹ Collect Changes
if: ${{ steps.package.outcome == 'success' }}
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
id: changes
uses: simbo/changes-between-tags-action@v1

- name: πŸ“¦ Create Release Package
if: ${{ steps.changes.outcome == 'success' }}
run: zip -r dist.zip dist

- name: 🎁 Create GitHub Release
if: ${{ steps.package.outcome == 'success' }}
if: ${{ steps.changes.outcome == 'success' }}
uses: ncipollo/release-action@v1
with:
name: Release ${{ steps.changes.outputs.tag }}
body: ${{ steps.changes.outputs.changes }}
artifacts: dist.zip

# - name: 🚚 Deploy to GitHub Pages
# if: ${{ steps.package.outcome == 'success' }}
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# folder: dist
# commit-message: Release ${{ github.ref_name }} from main @ ${{ github.sha }}
- name: 🚚 Deploy to GitHub Pages
if: ${{ steps.changes.outcome == 'success' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
commit-message: Release ${{ github.ref_name }} from ${{ github.sha }}

0 comments on commit 33ec3ed

Please sign in to comment.