Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dudushy committed Oct 7, 2024
1 parent 7828b16 commit e3bfe1f
Showing 1 changed file with 37 additions and 20 deletions.
57 changes: 37 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
name: Deploy to GitHub Pages via angular-cli-ghpages
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -22,23 +41,21 @@ jobs:
- name: Install dependencies
run: npm ci

# - name: Run tests
# run: npm run ng -- test --no-watch --no-progress --browsers=ChromeHeadless
- name: Test
run: npm test

- name: Setup Git Config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Build
run: npm run build

# - name: Build and Deploy
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: npm run deploy
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Build Angular Project
run: npm run build -- --configuration=production
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist build directory
path: "./dist/${{ github.event.repository.name }}/browser/"

- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx angular-cli-ghpages --dir=dist/qoder/browser --message="Deployed by GitHub Actions" --no-silent --branch=gh-pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit e3bfe1f

Please sign in to comment.