Skip to content

πŸ—οΈ CI/CD #1

πŸ—οΈ CI/CD

πŸ—οΈ CI/CD #1

name: build-and-deploy
run-name: πŸ—οΈ CI/CD
on:
push:
branches:
- master
- release/**
pull_request:
branches:
- master
- release/**
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
name: πŸ—οΈ Build
runs-on: ubuntu-latest
steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v3
- name: πŸ—οΈ PNPM Setup
uses: ./.github/actions/setup-pnpm
- name: πŸ”§ Install Dependencies
run: pnpm install
- name: πŸ”¨ Build
run: pnpm run build
- name: πŸ“¦ Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
name: "build-artifact-${{ github.sha }}"
path: build
deploy:
if: ${{ github.ref == 'refs/heads/master' }}
needs: [build]
name: πŸš€ Deploy
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
contents: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: "build-artifact-${{ github.sha }}"
preview: false
- name: Get the URL for the deployment
run: echo "${{ steps.deployment.outputs.page_url }}"