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: Production Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deploy-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Dependencies | |
run: npm install | |
- name: Install Nx CLI | |
run: npm install -g nx | |
- name: Build Frontend | |
run: nx build frontend --prod --base-href https://vv.danieljancar.dev/ | |
- name: Create CNAME | |
run: echo "vv.danieljancar.dev" > dist/apps/frontend/CNAME | |
- name: Configure Git User | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "gh-actions[bot]" | |
- name: Deploy to GitHub Pages | |
run: | | |
git init | |
git checkout --orphan gh-pages | |
git --work-tree dist/apps/frontend add --all | |
git --work-tree dist/apps/frontend commit -m 'Deploy' | |
git push -f origin gh-pages | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run Semantic Release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |