Test deployment new 13 #29
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: Deploy to GitHub Pages | |
# on: | |
# push: | |
# branches: | |
# - main | |
# jobs: | |
# # Test | |
# deploy: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Set up Node.js | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: "18" | |
# - name: Install Angular CLI | |
# run: npm install -g @angular/cli | |
# # - name: Install dependencies | |
# # run: npm install | |
# # - name: Build Angular app | |
# # run: ng build --configuration=production --base-href=https://ndricimrr.github.io/random-albanian-user-generator | |
# # - name: Deploy to GitHub Pages | |
# # uses: peaceiris/actions-gh-pages@v3 | |
# # with: | |
# # github_token: ${{ secrets.GITHUB_TOKEN }} | |
# # publish_dir: ./dist | |
# # - name: Deploy | |
# # uses: JamesIves/[email protected] | |
# # with: | |
# # branch: gh-pages # The branch the action should deploy to. | |
# # folder: dist # The folder the action should deploy. | |
# - name: Deploy to GitHub Pages | |
# uses: AhsanAyaz/[email protected] | |
# with: | |
# github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
# deploy_branch: main # optional, default is gh-pages | |
# angular_dist_build_folder: dist/app | |
name: Angular CI/CD | |
on: | |
push: | |
branches: | |
- main # Change this to your main branch | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 # Updated to use v3 | |
with: | |
node-version: "18" # Updated to Node.js 20 | |
check-latest: true | |
- name: Install Angular CLI | |
run: npm install -g @angular/cli | |
- name: Install dependencies | |
run: npm install | |
- name: Build Angular app | |
run: ng build --configuration=production --output-path docs --base-href=/random-albanian-user-generator/ | |
- name: Upload artifacts | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: docs # Change this to the output folder of your Angular build | |
# Deploy job | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
# environment: | |
# name: github-pages | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
# - name: Download artifacts | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: github-pages | |
# - name: Set up Node.js for deployment | |
# uses: actions/setup-node@v3 # Updated to use v3 | |
# with: | |
# node-version: "18" # Updated to Node.js 20 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action | |
# - name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v4 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# jobs: | |
# # Build job | |
# build: | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Set up Node.js | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: "18" | |
# - name: Install Angular CLI | |
# run: npm install -g @angular/cli | |
# - name: Install dependencies | |
# run: npm install | |
# - name: Build Angular app | |
# run: ng build --configuration=production --base-href=https://ndricimrr.github.io/random-albanian-user-generator | |
# # <Not provided for brevity> | |
# # At a minimum this job should upload artifacts using actions/upload-pages-artifact | |
# Deploy job | |
# deploy: | |
# # Add a dependency to the build job | |
# needs: build | |
# # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
# permissions: | |
# pages: write # to deploy to Pages | |
# id-token: write # to verify the deployment originates from an appropriate source | |
# # Deploy to the github-pages environment | |
# environment: | |
# name: github-pages | |
# url: ${{ steps.deployment.outputs.page_url }} | |
# # Specify runner + deployment step | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |