This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.74 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
name: Release Publish Data S3
on:
pull_request:
branches:
- main
types:
- closed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
jobs:
deploy:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
environment: Production
permissions:
id-token: write
contents: write
strategy:
matrix:
schema: [ microblink_receipt, shopify_order ]
steps:
- uses: actions/checkout@v4
- name: cargo-lambda
run: |
brew tap cargo-lambda/cargo-lambda
brew install cargo-lambda
- name: Setup Wrangler
run: |
cd infra && npm ci
- name: Deploy
run: |
cd infra
make deploy feature=${{ matrix.schema }}
- name: Secrets
run: |
cd infra
echo ${{ secrets.BUCKET_KEY_ID }} | wrangler secret put BUCKET_KEY_ID
echo ${{ secrets.BUCKET_KEY_SECRET }} | wrangler secret put BUCKET_KEY_SECRET
release:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Version
id: version
run: |
export CURRENT_VERSION=$(grep -m 1 'version = "' endpoint/Cargo.toml | awk -F '"' '{print $2}')
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.version.outputs.current }}