-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: separate flows for aws and release
- Loading branch information
Showing
2 changed files
with
66 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
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: Terraform Init | ||
uses: hashicorp/setup-terraform@v3 | ||
env: | ||
TF_ACTION_WORKING_DIR: 'terraform' | ||
|
||
- name: Terraform Init | ||
run: terraform init terraform | ||
|
||
- name: Terraform Apply | ||
run: terraform apply -auto-approve | ||
|
||
- name: Deploy | S3 | ||
run: | | ||
aws s3 sync ./dist/ s3://www.spencer.imbleau.com --delete |