Skip to content

Commit

Permalink
ci: separate flows for aws and release
Browse files Browse the repository at this point in the history
  • Loading branch information
simbleau committed Apr 25, 2024
1 parent f8f4720 commit 93d7c62
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 34 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/release-tagged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,37 +93,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}

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 Apply
run: terraform apply -auto-approve

- name: Deploy | S3
run: |
aws s3 sync ./dist/ s3://www.spencer.imbleau.com --delete
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 93d7c62

Please sign in to comment.