-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d49fb54
commit 8fd68e0
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Docker CI of PyTorch | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'pytorch-*' | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
IMAGE_NAME: docker-images | ||
|
||
steps: | ||
- name: Set Docker Image Name and Tag | ||
id: system | ||
run: | | ||
TAG=${GITHUB_REF#refs/tags/} | ||
IFS=- read -r IMAGE VERSION <<< $TAG | ||
echo "image=$IMAGE" >> $GITHUB_OUTPUT | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Build and Push Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./os/ | ||
file: ./os/Dockerfile | ||
platforms: | | ||
linux/amd64 | ||
push: true | ||
build-args: | | ||
SYSTEM_IMAGE=pytorch/pytorch | ||
SYSTEM_VERSION=${{ steps.system.outputs.version }} | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.system.outputs.image }}-${{ steps.system.outputs.version }} | ||
|
||
- name: Update repo description | ||
uses: peter-evans/dockerhub-description@v4 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
repository: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }} | ||
short-description: ${{ github.event.repository.description }} | ||
|
||
- name: Push Summary | ||
run: echo "### Build ${{ steps.system.outputs.image }}-${{ steps.system.outputs.version }} Successfully :rocket:" >> $GITHUB_STEP_SUMMARY |