mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-16 08:46:48 +00:00
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: Docker image build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- VERSION
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- 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: |
|
|
echo "aster_version=$( cat VERSION )" >> "$GITHUB_OUTPUT"
|
|
echo "rust_version=$( grep -m1 -o 'nightly-[0-9]\+-[0-9]\+-[0-9]\+' rust-toolchain.toml )" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and push development image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./tools/docker/Dockerfile.ubuntu22.04
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: asterinas/asterinas:${{ steps.fetch-versions.outputs.aster_version }}
|
|
build-args: |
|
|
"ASTER_RUST_VERSION=${{ steps.fetch-versions.outputs.rust_version }}"
|
|
|
|
- name: Build and push OSDK test image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./osdk/tools/Dockerfile.ubuntu22.04
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: asterinas/osdk:${{ steps.fetch-versions.outputs.aster_version }}
|
|
build-args: |
|
|
"ASTER_RUST_VERSION=${{ steps.fetch-versions.outputs.rust_version }}"
|