47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: Docker image build
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
# The image build workflow will be triggered if changes are present
|
|
# in the following files/directories. Make sure that all files used
|
|
# in the building process are listed here.
|
|
- tools/docker/**
|
|
- regression/syscall_test/**
|
|
- Cargo.toml
|
|
- rust-toolchain.toml
|
|
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@v3
|
|
|
|
- name: Fetch versions in the repo
|
|
id: fetch-versions
|
|
run: |
|
|
echo "jinux=$( grep -m1 -o '[0-9]\+\.[0-9]\+\.[0-9]\+' Cargo.toml | sed 's/[^0-9\.]//g' )" >> "$GITHUB_OUTPUT"
|
|
echo "rust=$( grep -m1 -o 'nightly-[0-9]\+-[0-9]\+-[0-9]\+' rust-toolchain.toml )" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./tools/docker/Dockerfile.ubuntu22.04
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: jinuxdev/jinux:${{ steps.fetch-versions.outputs.jinux }}
|
|
build-args: |
|
|
"JINUX_RUST_VERSION=${{ steps.fetch-versions.outputs.rust }}"
|