asterinas/.github/workflows/publish_docker_images.yml

81 lines
2.6 KiB
YAML

name: Publish Docker images
on:
workflow_dispatch:
push:
paths:
- DOCKER_IMAGE_VERSION
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Fetch versions in the repo
id: fetch-versions
run: |
ASTER_VERSION=$(cat DOCKER_IMAGE_VERSION)
RUST_VERSION=$(grep -m1 -o 'nightly-[0-9]\+-[0-9]\+-[0-9]\+' rust-toolchain.toml)
echo "aster_version=$ASTER_VERSION" >> "$GITHUB_OUTPUT"
echo "rust_version=$RUST_VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push the OSDK development image
uses: docker/build-push-action@v4
with:
context: .
file: ./osdk/tools/docker/Dockerfile
platforms: linux/amd64
push: true
load: true
tags: asterinas/osdk:${{ steps.fetch-versions.outputs.aster_version }}
build-args: |
ASTER_RUST_VERSION=${{ steps.fetch-versions.outputs.rust_version }}
- name: Build and push the OSDK development image for Intel TDX
uses: docker/build-push-action@v4
with:
context: .
file: ./osdk/tools/docker/tdx/Dockerfile
platforms: linux/amd64
push: true
tags: asterinas/osdk:${{ steps.fetch-versions.outputs.aster_version }}-tdx
build-args: |
BASE_VERSION=${{ steps.fetch-versions.outputs.aster_version }}
- name: Build and push the Asterinas development image
uses: docker/build-push-action@v4
with:
context: .
file: ./tools/docker/Dockerfile
platforms: linux/amd64
push: true
load: true
tags: asterinas/asterinas:${{ steps.fetch-versions.outputs.aster_version }}
build-args: |
BASE_VERSION=${{ steps.fetch-versions.outputs.aster_version }}
- name: Build and push the Asterinas development image for Intel TDX
uses: docker/build-push-action@v4
with:
context: .
file: ./tools/docker/tdx/Dockerfile
platforms: linux/amd64
push: true
tags: asterinas/asterinas:${{ steps.fetch-versions.outputs.aster_version }}-tdx
build-args: |
BASE_VERSION=${{ steps.fetch-versions.outputs.aster_version }}