-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.87 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
name: Release Latest
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Setup | Trunk
uses: jetli/[email protected]
with:
version: "latest"
- name: Build | Trunk
run: trunk build --release
- name: Post Setup | Upload dist
uses: actions/upload-artifact@v4
with:
path: ./dist/
aws:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup | Download dist
uses: actions/download-artifact@v4
- name: Setup | Place dist
run: mv ./artifact/ ./dist/
- name: Configure | AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
role-duration-seconds: 3600
role-session-name: GitHubActions
- name: Setup | Terraform
uses: hashicorp/setup-terraform@v3
env:
TF_ACTION_WORKING_DIR: 'terraform'
- name: Terraform | Apply
run: |
cd terraform
terraform init
terraform apply -auto-approve
env:
TF_VAR_cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
TF_VAR_aws_region: ${{ secrets.AWS_REGION }}
TF_VAR_aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
TF_VAR_aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Deploy | S3
run: |
aws s3 sync ./dist/ s3://www.spencer.imbleau.com --delete