Skip to content

Commit

Permalink
fix(*): update master pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
HoseaCodes committed May 27, 2024
1 parent f2593f8 commit 5411999
Showing 1 changed file with 89 additions and 1 deletion.
90 changes: 89 additions & 1 deletion .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,92 @@ jobs:
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
command: monitor
build:
needs: [security]
runs-on: ubuntu-latest
outputs:
build_path: ${{ steps.archive_build.outputs.build_path }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: Build project
run: |
export SKIP_PREFLIGHT_CHECK=true
npm run build
- name: Archive build output
id: archive_build
run: |
tar -czf build.tar.gz build/
echo "::set-output name=build_path::build.tar.gz"
- name: Create conventional changelog action
id: changelog
uses: TriPSs/conventional-changelog-action@latest
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
tag-prefix: "dev.v"
git-push: false
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: Release ${{ steps.changelog.outputs.tag }}
body: ${{steps.changelog.outputs.clean_changelog}}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build.tar.gz
asset_name: build.tar.gz
asset_content_type: application/gzip
- name: Deploy to Heroku
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: hoseacodes-dev
heroku_email: "[email protected]"
release:
needs: [build]
name: Release pushed tag
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # required for github-action-get-previous-tag
- name: Get previous tag
id: previoustag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get next minor version
id: semver
uses: 'WyriHaximus/github-action-next-semvers@v1'
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Create release
id: create_release_id
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag ${{ steps.semver.outputs.patch }}" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes
with:
tag_name: ${{ steps.semver.outputs.patch }}
release_name: Release ${{ steps.semver.outputs.patch }}

0 comments on commit 5411999

Please sign in to comment.