Skip to content

Commit

Permalink
github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
honzov committed Apr 16, 2024
1 parent 9bae46d commit 83b2094
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/actions/build-push-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Build and push docker image'
description: 'Build our dockerfile'
inputs:
imgname:
description: 'Name of the image to build'
required: true
runs:
using: composite
steps:
- run: |
TODAY=$(date +'%Y-%m-%d')
cd dockerfiles
sudo docker build -f Dockerfile.${imgname} --rm --no-cache -t "iterait/${imgname}:${TODAY}" -t "iterait/${imgname}:latest" --squash .
shell: bash
env:
imgname: ${{ inputs.imgname }}
66 changes: 66 additions & 0 deletions .github/workflows/build-push-images-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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: 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
uses: ./.github/actions/build-push-image
with:
imgname: archlinux




# - 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 }}

0 comments on commit 83b2094

Please sign in to comment.