diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..38a4a59 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,52 @@ +name: Angular GitHub CI/CD +on: + push: + branches: [ main ] + + workflow_dispatch: + +jobs: + build-and-release: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.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: Install Dependencies + run: | + npm ci + + - name: Build + run: | + npm run build -- --prod + + # - name: Lint + # run: | + # npm run lint + + # - name: Test + # run: | + # npm run test:ci + + - name: Run semantic release and publish new version to npm + run: npm run semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + + - name: Deploy to Github pages + uses: crazy-max/ghaction-github-pages@v2 + # action to deploy to GitHub Pages + with: + target_branch: gh-pages + build_dir: ./dist + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}