diff --git a/.github/workflows/release-tagged.yml b/.github/workflows/release-tagged.yml index 088aefd..1aa570a 100644 --- a/.github/workflows/release-tagged.yml +++ b/.github/workflows/release-tagged.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d115fce --- /dev/null +++ b/.github/workflows/release.yml @@ -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/trunk-action@v0.5.0 + 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 \ No newline at end of file