-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (57 loc) · 1.76 KB
/
deploy-to-prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build and Deploy Binq Static Web
concurrency:
group: production
cancel-in-progress: true
run-name: Building and Deploying
on:
push:
pull_request:
branches:
- "dev"
- "feature-**/"
- "master"
env:
NODE_VERSION: 20.10.0
RUN_NUM: github.run_number
jobs:
job_1_build:
name: Build and Upload Production Artifact
runs-on: ubuntu-latest
steps:
- run: echo "Attempting to install required tools and build project"
- uses: actions/checkout@v4
- name: "Use Node.js ${{ env.NODE_VERSION }}"
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Install Dependencies and Build project
run: |
npm ci
npx tailwindcss build -i ./src/input.css -o ./src/output.css --minify
npm run build --f-present
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./dist"
- run: echo "🍏 Build and save artifact status is a ${{ job.status }} on ${{ github.ref }} branch"
job_2_deploy:
name: Deploy Website to GitHub Pages
needs: job_1_build
# Grant GITHUB_TOKEN permissions required to make pages deployment
permissions:
pages: write
id-token: write
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub pages
id: deployment
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Job status of deployment
run: echo "🍏 Deploy to GitHub pages is a ${{ job.status }} to ${{ steps.deployment.outputs.page_url }}"