Last active
February 3, 2023 20:04
-
-
Save rupeshtiwari/9f252dc665656c434c4d50a70519f9ac to your computer and use it in GitHub Desktop.
angular ci cd deploy to github pages use conventional change log
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: Angular GitHub CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [10.x, 12.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node modules | |
id: cache-nodemodules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# caching node_modules | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: | | |
npm ci | |
- name: Build | |
run: | | |
npm run build -- --prod | |
- name: Lint | |
run: | | |
npm run lint | |
- name: Test | |
run: | | |
npm run test -- --prod | |
- name: Conventional Changelog Action | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v3 | |
with: | |
github-token: ${{ secrets.TOKEN_GITHUB_ACTION }} | |
output-file: "false" | |
- name: Create Release | |
uses: actions/create-release@v1 | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB_ACTION }} | |
with: | |
tag_name: ${{ steps.changelog.outputs.tag }} | |
release_name: ${{ steps.changelog.outputs.tag }} | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
- name: Deploy | |
run: | | |
npm run deploy | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, first.. thanks for sharing this amazing content!
I'm running into an issue with this staff.
When the deploying from my local computer, it works perfectly!
But my GH action fails.
Here are the logs.
Thanks in advance.