Add templates
This commit is contained in:
0
docker/README.md
Normal file
0
docker/README.md
Normal file
23
docker/build/build-image.sh
Executable file
23
docker/build/build-image.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "=> Build will be tagged with $1 and build directory is $(pwd)"
|
||||
|
||||
OLD_IMG=$(docker image ls -q "$1")
|
||||
docker buildx build . -t "$1"
|
||||
|
||||
echo "
|
||||
=> Build complete, starting upload...
|
||||
"
|
||||
|
||||
docker push "$1"
|
||||
|
||||
if [ -n "$OLD_IMG" ]; then
|
||||
if [ "$OLD_IMG" != "$(docker image ls -q "$1")" ]; then
|
||||
echo "
|
||||
=> New build uploaded, removing old image, id: $OLD_IMG
|
||||
"
|
||||
docker image rmi -f "$OLD_IMG" || true
|
||||
fi
|
||||
fi
|
||||
16
docker/build/docker-build.yml
Normal file
16
docker/build/docker-build.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
name: Create and publish container
|
||||
on:
|
||||
push
|
||||
jobs:
|
||||
build_container:
|
||||
runs_on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: main
|
||||
- name: Build and upload image
|
||||
run: |
|
||||
docker login ${{ vars.REGISTRY_URL }} -u ${{ vars.REGISTRY_USER_USERNAME }} -p "${{ secrets.REGISTRY_USER_PASSWORD_ESCAPED }}"
|
||||
# Run the docker build command. Preferrably use the provided wrapper function
|
||||
./build-image.sh ${{ vars.REGISTRY_NAME }}/container-name
|
||||
0
docker/deploy/docker-deploy.yml
Normal file
0
docker/deploy/docker-deploy.yml
Normal file
Reference in New Issue
Block a user