Migrate from Gramine to Intel TDX #35
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: Build and Release | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: write | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
load: true | |
tags: | | |
my-proof:${{ github.run_number }} | |
my-proof:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Export image to file | |
run: | | |
docker save my-proof:latest | gzip > my-proof-${{ github.run_number }}.tar.gz | |
- name: Generate release body | |
run: | | |
echo "Image SHA256: $(sha256sum my-proof-${{ github.run_number }}.tar.gz | cut -d' ' -f1)" >> release_body.txt | |
- name: Upload image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: my-proof-image | |
path: my-proof-${{ github.run_number }}.tar.gz | |
- name: Create Release and Upload Assets | |
uses: softprops/action-gh-release@v1 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ github.run_number }} | |
name: Release v${{ github.run_number }} | |
body_path: release_body.txt | |
draft: false | |
prerelease: false | |
files: | | |
./my-proof-${{ github.run_number }}.tar.gz | |
- name: Log build result | |
if: always() | |
run: | | |
if [ ${{ job.status }} == "success" ]; then | |
echo "Build and release completed successfully" | |
else | |
echo "Build and release failed" | |
fi |