-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (56 loc) · 1.61 KB
/
Copy pathdeploy.yml
File metadata and controls
64 lines (56 loc) · 1.61 KB
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
name: Deploy
on:
push:
tags:
- "v*"
branches:
- main
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
detect-deploy:
runs-on: ubuntu-latest
outputs:
stack: ${{ steps.detect.outputs.stack }}
steps:
- id: detect
run: |
if [[ "${{ github.ref_type }}" == "tag" && "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "stack=production" >> $GITHUB_OUTPUT
else
echo "stack=dev" >> $GITHUB_OUTPUT
fi
deploy:
needs: detect-deploy
runs-on: ubuntu-latest
environment: cloudflare
timeout-minutes: 20
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.sha }}
- uses: actions/setup-node@v6
with:
node-version-file: ".node-version"
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Applying infrastructure 🚀
uses: pulumi/actions@v6
with:
command: up
work-dir: infra
stack-name: ${{ needs.detect-deploy.outputs.stack }}
cloud-url: ${{ secrets.PULUMI_BACKEND_URL }}
env:
AWS_REGION: auto
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}