60 words
1 minute
Automatically Deploy Angular Pages with GitHub Actions
angular.json
projects > {your-project-name} > architect > build > options > outputPath
If the default static webpage is generated under the browser, remember to modify/add the property
"baseHref": "/browser/",Install angular-cli-ghpages
ng add angular-cli-ghpagesCreate a workflow in .github/workflows
name: Deploy to GitHub Pages
on: push: branches: - master # 或者你要监控的分支名称
jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3
- name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '20' # 请根据项目需求修改 Node.js 版本
- name: Install dependencies run: npm install
- name: Build project run: npm run build
- name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4 with: folder: dist/my-angular-project/browser # 请根据实际输出路径填写 token: ${{ secrets.TOKEN }}
env: GITHUB_TOKEN: ${{ secrets.TOKEN }}Remember to generate a token on GitHub to access the repo, and add it to the action’s environment variables.
https://github.com/${your_name}/${your_repo}/settings/secrets/actions
Push to the monitored branch
Modify the GitHub Pages configuration, and set the Pages branch to gh-pages
Share
If this article helped you, please share it with others!
Automatically Deploy Angular Pages with GitHub Actions
https://dreaife.tokyo/en/posts/github-action-angular/ Some information may be outdated
Related Posts Smart
1
Angular-Based Animation Showcase Website with Login and Registration (Cognito)
PROJECT This Angular-based web application lets users browse and search for anime on Bangumi, with Cognito for user authentication. It supports automated builds and deployment to GitHub Pages via GitHub Actions. The main technology stack includes Angular 16, TypeScript, HTML, and CSS. The project has a clear structure and provides user login, registration, search, and anime calendar features.
2
Blog Migration - Mizuki Configuration Records
infra A record of the migration from NotionNext to Mizuki, mainly due to NotionNext's limitations. Mizuki was chosen for its lightweight nature and good balance of features, supporting diaries and project showcases. The configuration process is simple, with content controlled via md and ts files, and it also connects to the Bangumi API. The plan is to synchronize Notion content via CI, implement multilingual support, and address the issue of image links expiring.
3
Getting Started with Docker
infra Docker is a technology for solving microservice deployment problems by packaging applications and their dependencies into isolated containers, avoiding inconsistent environments and dependency conflicts. Compared with virtual machines, Docker starts faster and uses fewer resources. Its architecture includes images and containers, and users can share and obtain images through Docker Hub. Basic operations include creating and managing images and containers and using volumes for data persistence and host-container decoupling. Docker Compose can simplify distributed application deployment.
4
Using SVN
infra SVN is a centralized file management/version control tool that supports fine-grained file access management. Before use, a repository must be created, and graphical clients such as TortoiseSVN are recommended. Common commands include checkout, commit, update, add, delete, log, diff, revert, and ignore, and the article also covers branch management and help commands. Detailed command usage is listed to help users get started quickly.
5
A Summary of My Thoughts on the Market on X
market Drawing on complex systems and game theory, this post unpacks the underlying logic of market dynamics, emotional reflexivity, and the consensus underpinning monetary value, helping readers look beyond short-term volatility and develop a deeper understanding of market expectations and inflation transmission.
Random Posts Random
1
The First Round of Screening in the New Era
life 2026-04-09
2
Installing Oh My Zsh and Its Plugins on Ubuntu
cs-base 2024-12-03
3
Running pyspider on Windows 11 with Docker
spider 2024-01-02
4
Personal Crisis Management and Future Income Planning
life 2025-01-23
5
Angular-Based Animation Showcase Website with Login and Registration (Cognito)
PROJECT 2024-11-12





