Merge pull request #9 from yoshuawuyts/remove-wit- #7
This file contains hidden or 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: Publish a Wasm Component to GitHub Artifacts | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache cargo bin | |
id: cache-cargo | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cargo-bin | |
with: | |
path: ~/.cargo/bin | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('scripts/install.sh') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} | |
name: Run install script | |
continue-on-error: false | |
run: bash scripts/install.sh | |
- name: Run build script | |
run: bash scripts/build.sh | |
- name: Run publish script | |
run: bash scripts/publish.sh |