-
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.
adding github actions yaml and Dockerfile
- Loading branch information
Showing
2 changed files
with
48 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,46 @@ | ||
name: Pushing Updated Image CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- metadata/Dockerfile | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Logging into GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GH_USERNAME }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
- uses: actions/checkout@v2 | ||
- name: Check Dockerfile and Update Image | ||
id: update_image | ||
run: | | ||
cd metadata | ||
if [ $(cat Dockerfile | grep . | wc -l) -gt 1 ]; then | ||
dockername="${{ github.event.repository.name }}" | ||
#dockername=$(head -n 1 Dockerfile | grep . | cut -d'/' -f3 | cut -d':' -f1) | ||
new_tag=$(echo $(TZ=EST5EDT date +%b_%d_%I-%M-%S_%Y) | tr '[:upper:]' '[:lower:]') | ||
echo $dockername | ||
echo $new_tag | ||
sudo snap install yq | ||
echo "Updating image from Dockerfile" | ||
docker build . -t $dockername | ||
docker tag $dockername ghcr.io/compbiocore/$dockername:$new_tag | ||
docker push ghcr.io/compbiocore/$dockername:$new_tag | ||
docker tag $dockername ghcr.io/compbiocore/$dockername:latest | ||
docker push ghcr.io/compbiocore/$dockername:latest | ||
git config --global user.name "someone" | ||
git config --global user.email "[email protected]" | ||
mkdir -p docker_builds | ||
mkdir -p docker_builds/$new_tag | ||
mv Dockerfile docker_builds/$new_tag/Dockerfile | ||
echo "FROM ghcr.io/compbiocore/$dockername:$new_tag" > Dockerfile | ||
git add -A | ||
git commit -m "Dockerfile pulling from latest repo image" | ||
git push origin main | ||
fi |
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,2 @@ | ||
FROM ghcr.io/compbiocore/bootcamp_scrna:mar_25_10-42-25_2024 | ||
|