-
-
Notifications
You must be signed in to change notification settings - Fork 30
88 lines (78 loc) · 2.26 KB
/
release.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Release
on:
push:
branches:
- main
- beta
workflow_dispatch:
jobs:
setup:
name: Set environment variables
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
DEPLOY_ENVIRONMENT: ${{ steps.env.outputs.DEPLOY_ENVIRONMENT }}
DEPLOY_SUBDOMAIN: ${{ steps.env.outputs.DEPLOY_SUBDOMAIN }}
steps:
- name: "☁️ compute environment variables"
id: env
run: |
DEPLOY_ENVIRONMENT=$([[ ${{ github.ref_name }} == 'main' ]] && echo 'production' || echo ${{ github.ref_name }})
DEPLOY_SUBDOMAIN=$([[ ${{ github.ref_name }} == 'main' ]] && echo '' || echo "${{ github.ref_name }}.")
echo "DEPLOY_ENVIRONMENT=$DEPLOY_ENVIRONMENT" >> $GITHUB_ENV
echo "DEPLOY_SUBDOMAIN=$DEPLOY_SUBDOMAIN" >> $GITHUB_ENV
build:
name: Build application
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v3
- name: "🔧 setup Bun"
uses: oven-sh/setup-bun@v1
- name: "📦 install dependencies"
run: bun install
- name: "🚀 static app"
run: bun run build
- name: "📂 production artifacts"
uses: actions/upload-artifact@v2
with:
name: build
path: dist
release:
environment:
name: ${{ needs.setup.outputs.DEPLOY_ENVIRONMENT }}
url: https://${{ needs.setup.outputs.DEPLOY_SUBDOMAIN }}insights.opensauced.pizza
name: Semantic release
needs:
- setup
- build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "📂 download build artifacts"
uses: actions/download-artifact@v2
with:
name: build
path: dist
- name: "🚀 release"
id: semantic-release
uses: open-sauced/release@v2.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cleanup:
name: Cleanup actions
needs:
- release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: |
build