mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 14:16:47 +00:00
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
name: Publish Docker images
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- tools/BUILD_CONTAINER_VERSION
|
|
branches:
|
|
- master
|
|
|
|
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: |
|
|
BUILD_CONTAINER_VERSION=$(cat tools/BUILD_CONTAINER_VERSION)
|
|
echo "build_container_version=$BUILD_CONTAINER_VERSION" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and push docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: "{{defaultContext}}:tools"
|
|
file: Dockerfile
|
|
platforms: linux/amd64
|
|
push: ${{ github.repository == 'DragonOS-Community/DragonOS' }}
|
|
tags: dragonos/dragonos-dev:${{ steps.fetch-versions.outputs.build_container_version }}
|