fix: add table of contents #3
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: Build and Deploy AO/HyperBEAM | |
on: | |
push: | |
branches: | |
- main | |
- feat/cd # To be removed before merging | |
env: | |
GCP_IMAGE_NAME: hyperbeam-image | |
GCP_PROJECT: hyperbeam-cd | |
GCP_INSTANCE_NAME: hyperbeam | |
GCP_ZONE: us-east1-a | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: auth | |
name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.CD_SERVICE_ACCOUNT }} | |
- name: Setup GCloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Setup build tools (Erlang, Packer and Rebar3) | |
run: | | |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | |
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | |
sudo apt-get update | |
sudo apt-get install packer | |
sudo apt-get install -y erlang | |
wget https://s3.amazonaws.com/rebar3/rebar3 | |
chmod +x rebar3 | |
sudo mv rebar3 /usr/local/bin/ | |
- name: Build and release AO/HyperBEAM with Rebar3 | |
run: | | |
rebar3 clean | |
rebar3 get-deps | |
rebar3 compile | |
rebar3 release | |
- name: Build Packer Image | |
run: | | |
packer init . | |
packer validate . | |
packer build -var "image_name=${{ env.GCP_IMAGE_NAME }}" -var "project_id=${{ env.GCP_PROJECT }}" . | |
- name: Create Confidential VM | |
run: | | |
gcloud compute instance create ${{ env.GCP_INSTANCE_NAME }} \ | |
--image=${{ env.GCP_IMAGE_NAME }} \ | |
--project=${{ env.GCP_PROJECT }} \ | |
--zone=${{ env.GCP_ZONE }} \ | |
--machine-type=n2d-standard-2 \ | |
--min-cpu-platform="AMD Milan" \ | |
--confidential-compute-type=SEV_SNP \ | |
--maintenance-policy=TERMINATE \ | |
--image-family=ubuntu-2404-lts-amd64 \ | |
--image-project=ubuntu-os-cloud \ | |
--network-interface=network-tier=PREMIUM,nic-type=GVNIC,stack-type=IPV4_ONLY,subnet=default \ | |
--tags=http-server,https-server \ | |
--shielded-secure-boot \ | |
--shielded-vtpm \ | |
--shielded-integrity-monitoring | |
--create-disk=auto-delete=yes,boot=yes,image=projects/${{ env.GCP_PROJECT }}/global/images/${{ env.GCP_IMAGE_NAME }},mode=rw,size=20,type=pd-balanced | |
- name: Delete Confidential VM | |
run: | | |
gcloud compute instances delete ${{ env.GCP_INSTANCE_NAME }} \ | |
--project=${{ env.GCP_PROJECT }} \ | |
--zone=${{ env.GCP_ZONE }} |