Image Build #15
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: Image Build | |
on: | |
workflow_dispatch | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
image: | |
if: github.actor == 'chkimes' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4 | |
- name: Setup Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 #v5 | |
with: | |
go-version: 1.18 | |
- name: Build Attestation Client + Server | |
run: | | |
cd attest | |
go get ./... | |
go build -o ../build-azure ./... | |
- name: Login to Azure | |
uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a #v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Build Azure VM | |
env: | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} | |
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }} | |
AZURE_VM_NAME: ${{ secrets.AZURE_VM_NAME }} | |
run: | | |
set -e | |
build-azure/build.sh | |
mkdir img | |
tar -xzvf image.tar.gz -C img | |
- name: Upload artifacts | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4 | |
with: | |
name: image | |
path: img/* | |
- name: Generate provenance | |
uses: github-early-access/generate-build-provenance@67d881a62db43e3a31b5d5fdc5454a540c7ea56e #main | |
with: | |
subject-path: img/* | |