feat: add CI builds + attestation #8
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: cloud-hello | ||
on: | ||
pull_request: | ||
merge_group: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- cloud-hello-v* | ||
paths: | ||
- 'cloud-hello/**' | ||
env: | ||
REGISTRY: ghcr.io | ||
REPOSITORY: ${{ github.repository }} | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: cargo clippy --no-deps | ||
working-directory: cloud-hello | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
rustup target add wasm32-wasi | ||
cargo build --target wasm32-wasi | ||
working-directory: cloud-hello | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
#if: startsWith(github.ref, 'refs/tags/cloud-hello-v') | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: rustup target add wasm32-wasi | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: wash-cli@latest | ||
- name: Build and push | ||
run: | | ||
wash build | ||
working-directory: cloud-hello | ||
- name: Push | ||
id: push | ||
env: | ||
WASH_REG_USER: ${{ github.repository_owner }} | ||
WASH_REG_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
Check failure on line 59 in .github/workflows/cloud-hello.yml GitHub Actions / cloud-helloInvalid workflow file
|
||
wash push ${{env.REGISTRY}/${{env.REPOSITORY}}/cloud-hello:$GITHUB_SHA | ||
echo "digest=$(docker manifest inspect {{env.REGISTRY}}/{{env.REPOSITORY}}:$GITHUB_SHA | jq .config.digest -r)" >> "$GITHUB_OUTPUT" | ||
working-directory: cloud-hello | ||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ghcr.io/${{github.repository}}/cloud-hello | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |