SHA256
Update deploy.yml
This commit is contained in:
1 parent
a2cd76f3fc
commit
d55fd81441
1 file changed
+10
-38
+10
-38
@@ -10,53 +10,26 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
strategy:
|
runs-on: local
|
||||||
matrix:
|
|
||||||
runner: [linux-amd64, linux-arm64]
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Node.js
|
|
||||||
run: |
|
|
||||||
if command -v apt-get &> /dev/null; then
|
|
||||||
sudo apt-get update && sudo apt-get install -y nodejs
|
|
||||||
elif command -v yum &> /dev/null; then
|
|
||||||
sudo yum install -y nodejs
|
|
||||||
elif command -v apk &> /dev/null; then
|
|
||||||
apk add nodejs
|
|
||||||
else
|
|
||||||
echo "Package manager not found. Please pre-install Node.js on the runner host."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Prepare Git for SHA256 Repo
|
|
||||||
run: git config --global init.defaultObjectFormat sha256
|
|
||||||
|
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to DHI Registry
|
- name: Log in to DHI Registry
|
||||||
uses: docker/login-action@v3
|
run: |
|
||||||
with:
|
echo "${{ secrets.DHI_PASSWORD }}" | docker login dhi.io -u "${{ secrets.DHI_USERNAME }}" --password-stdin
|
||||||
registry: dhi.io
|
|
||||||
username: ${{ secrets.DHI_USERNAME }}
|
|
||||||
password: ${{ secrets.DHI_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
run: |
|
||||||
with:
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.chillcog.com -u "${{ git.repository_owner }}" --password-stdin
|
||||||
registry: git.chillcog.com
|
|
||||||
username: ${{ git.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Detect and Build Images
|
- name: Detect and Build Images
|
||||||
run: |
|
run: |
|
||||||
FILES_TO_BUILD=""
|
FILES_TO_BUILD=""
|
||||||
REGISTRY_HOST="git.chillcog.com" #
|
REGISTRY_HOST="git.chillcog.com"
|
||||||
OWNER_LOWER=$(echo "${{ git.repository_owner }}" | tr '[:upper:]' '[:lower:]')
|
OWNER_LOWER=$(echo "${{ git.repository_owner }}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
@@ -78,11 +51,10 @@ jobs:
|
|||||||
echo "Processing: $file -> Target: ${REGISTRY_HOST}/${OWNER_LOWER}/${image_name}:latest"
|
echo "Processing: $file -> Target: ${REGISTRY_HOST}/${OWNER_LOWER}/${image_name}:latest"
|
||||||
echo "---------------------------------------------------"
|
echo "---------------------------------------------------"
|
||||||
|
|
||||||
docker buildx build \
|
docker build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
|
||||||
--push \
|
|
||||||
--no-cache \
|
|
||||||
-f "$file" \
|
-f "$file" \
|
||||||
-t "${REGISTRY_HOST}/${OWNER_LOWER}/${image_name}:latest" \
|
-t "${REGISTRY_HOST}/${OWNER_LOWER}/${image_name}:latest" \
|
||||||
.
|
.
|
||||||
|
|
||||||
|
docker push "${REGISTRY_HOST}/${OWNER_LOWER}/${image_name}:latest"
|
||||||
done
|
done
|
||||||
Reference in new issue
Block a user