-
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
Showing
2 changed files
with
95 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,36 @@ | ||
name: 'Build and push docker image' | ||
description: 'Build our dockerfile' | ||
inputs: | ||
imgname: | ||
description: 'Name of the image to build' | ||
required: true | ||
build_cuda: | ||
description: 'Flag to indicate whether to build with CUDA support' | ||
required: true | ||
dockerhub_token_user: | ||
description: 'Docker username' | ||
required: true | ||
dockerhub_token: | ||
description: Docker password | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
TODAY=$(date +'%Y-%m-%d') | ||
cd dockerfiles | ||
sudo docker login -u ${dockerhub_token_user} -p ${dockerhub_token} | ||
sudo docker build -f Dockerfile.${imgname} --rm --no-cache -t "iterait/${imgname}:${TODAY}" -t "iterait/${imgname}:latest" --squash . | ||
sudo docker push iterait/${imgname}:latest | ||
sudo docker push iterait/${imgname}:"${TODAY}" | ||
if [ "${build_cuda}" == "true" ]; then | ||
sudo docker build -f Dockerfile.${imgname} --rm --no-cache --build-arg tag="cuda" -t "iterait/${imgname}:cuda_${TODAY}" -t "iterait/${imgname}:cuda" --squash . | ||
sudo docker push iterait/${imgname}:cuda | ||
sudo docker push iterait/${imgname}:"cuda_${TODAY}" | ||
fi | ||
shell: bash | ||
env: | ||
imgname: ${{ inputs.imgname }} | ||
build_cuda: ${{ inputs.build_cuda }} | ||
dockerhub_token_user: ${{ inputs.dockerhub_token_user }} | ||
dockerhub_token: ${{ inputs.dockerhub_token }} |
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,59 @@ | ||
name: Docker Images Build | ||
|
||
on: | ||
push: | ||
|
||
# schedule: | ||
# - cron: '0 3 * * *' | ||
|
||
jobs: | ||
build_archlinux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
uses: ./.github/actions/build-push-image | ||
with: | ||
imgname: archlinux | ||
build_cuda: false | ||
dockerhub_token_user: ${{ secrets.DOCKERHUB_TOKEN_USER }} | ||
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# - name: Checkout code | ||
# uses: actions/checkout@v4 | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v3 | ||
# - name: Login to Docker hub | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_TOKEN_USER }} | ||
# password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
# - name: Build and push archlinux | ||
# run: | | ||
# TODAY=$(date +'%Y-%m-%d') | ||
# cd dockerfiles | ||
# for imgname in archlinux ; do | ||
# docker build -f Dockerfile.${imgname} --no-cache --platform linux/amd64 --push \ | ||
# -t "iterait/${imgname}:${TODAY}" -t "iterait/${imgname}:latest" \ | ||
# -t "iterait/${imgname}:cuda_${TODAY}" -t "iterait/${imgname}:cuda" \ | ||
# --build-arg tag="cuda" --squash . | ||
# done | ||
# build_and_push_images: | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
|
||
|
||
# - name: Build and push Docker images | ||
# run: | | ||
# TODAY=$(date +'%Y-%m-%d') | ||
# for imgname in archlinux archlinux-dev tensorflow; do | ||
# docker buildx build -f Dockerfile.${imgname} --no-cache --platform linux/amd64 --push \ | ||
# -t "iterait/${imgname}:${TODAY}" -t "iterait/${imgname}:latest" \ | ||
# -t "iterait/${imgname}:cuda_${TODAY}" -t "iterait/${imgname}:cuda" \ | ||
# --build-arg tag="cuda" --squash . | ||
# done | ||
# env: | ||
# CIRCLE_BRANCH: ${{ github.ref }} | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |