fix: blog link #12
Workflow file for this run
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
name: Release Tagged | |
on: | |
push: | |
tags: ["v*"] | |
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@v3 | |
with: | |
path: ./dist/ | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | Download dist | |
uses: actions/download-artifact@v3 | |
- name: Setup | Place dist | |
run: mv ./artifact/ ./dist/ | |
- name: Release | Prepare artifacts | |
run: | | |
tar czvf dist.tar.gz dist | |
zip -9 -r dist.zip dist | |
- name: Release | Create checksums | |
run: | | |
openssl dgst -sha256 -r dist.tar.gz | awk '{print $1}' > dist.tar.gz.sha256 | |
openssl dgst -sha256 -r dist.zip | awk '{print $1}' > dist.zip.sha256 | |
# Upload to tag | |
- name: Release | Tagged | |
uses: softprops/action-gh-release@v1 | |
with: | |
fail_on_unmatched_files: true | |
files: | | |
dist.tar.gz | |
dist.tar.gz.sha256 | |
dist.zip | |
dist.zip.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Replace latest release | |
- name: Clean | Latest | |
uses: dev-drprasad/[email protected] | |
with: | |
delete_release: true | |
tag_name: latest | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | Latest | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: "latest" | |
name: My Website | |
body: "The latest distributable compilation, usually denoted `public/` or `dist/`, of my website." | |
fail_on_unmatched_files: true | |
files: | | |
dist.tar.gz | |
dist.tar.gz.sha256 | |
dist.zip | |
dist.zip.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | Publish | |
uses: eregon/publish-release@v1 | |
env: | |
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@v3 | |
- 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: 1200 | |
role-session-name: GitHubActions | |
- name: Deploy | S3 | |
run: | | |
aws s3 sync ./dist/ s3://simbleau-website --delete |