76 lines
2.8 KiB
YAML
76 lines
2.8 KiB
YAML
name: Publish Docker images
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- DOCKER_IMAGE_VERSION
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
publish_osdk_image:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Prepare for Docker build and push
|
|
id: prepare-for-docker-build-and-push
|
|
run: |
|
|
./tools/github_workflows/prepare_for_docker_build_and_push.sh ${{ secrets.DOCKERHUB_USERNAME }} ${{ secrets.DOCKERHUB_TOKEN }} osdk
|
|
|
|
- name: Build and push the OSDK development image
|
|
if: ${{ steps.prepare-for-docker-build-and-push.outputs.is_existed == 'false' }}
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./osdk/tools/docker/Dockerfile
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: asterinas/osdk:${{ steps.prepare-for-docker-build-and-push.outputs.image_version }}
|
|
build-args: |
|
|
ASTER_RUST_VERSION=${{ steps.prepare-for-docker-build-and-push.outputs.rust_version }}
|
|
|
|
publish_nix_image:
|
|
needs: publish_osdk_image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Prepare for Docker build and push
|
|
id: prepare-for-docker-build-and-push
|
|
run: |
|
|
./tools/github_workflows/prepare_for_docker_build_and_push.sh ${{ secrets.DOCKERHUB_USERNAME }} ${{ secrets.DOCKERHUB_TOKEN }} nix
|
|
|
|
- name: Build and push the Nix image
|
|
if: ${{ steps.prepare-for-docker-build-and-push.outputs.is_existed == 'false' }}
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./tools/docker/nix/Dockerfile
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: asterinas/nix:${{ steps.prepare-for-docker-build-and-push.outputs.image_version }}
|
|
build-args: |
|
|
BASE_VERSION=${{ steps.prepare-for-docker-build-and-push.outputs.image_version }}
|
|
|
|
publish_asterinas_image:
|
|
needs: publish_nix_image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Prepare for Docker build and push
|
|
id: prepare-for-docker-build-and-push
|
|
run: |
|
|
./tools/github_workflows/prepare_for_docker_build_and_push.sh ${{ secrets.DOCKERHUB_USERNAME }} ${{ secrets.DOCKERHUB_TOKEN }} asterinas
|
|
|
|
- name: Build and push the Asterinas development image
|
|
if: ${{ steps.prepare-for-docker-build-and-push.outputs.is_existed == 'false' }}
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./tools/docker/Dockerfile
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: asterinas/asterinas:${{ steps.prepare-for-docker-build-and-push.outputs.image_version }}
|
|
build-args: |
|
|
BASE_VERSION=${{ steps.prepare-for-docker-build-and-push.outputs.image_version }}
|