diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..315c52a --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,33 @@ +name: GitHub Pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Install dependencies + run: npm ci + + + - name: Build + run: npm run build + + - name: Deploy + if: success() + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: dist/angular-github-actions + enable_jekyll: true \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 9747965..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,32 +0,0 @@ -on: push -name: Build Angular -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - - steps: - - uses: actions/checkout@v1 - - - name: Cache node modules - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Node ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: npm install and npm run build - run: | - npm i - npm run build - - name: Push Build to Releases - uses: ncipollo/release-action@v1 - with: - artifacts: "dist/angular-githubaction/*" - token: ${{ secrets.TOKEN }} \ No newline at end of file