fix build
This commit is contained in:
parent
f01b9054b5
commit
22f1c70f20
1 changed files with 27 additions and 56 deletions
|
|
@ -36,20 +36,34 @@ jobs:
|
||||||
username: ${{ env.REGISTRY_USERNAME }}
|
username: ${{ env.REGISTRY_USERNAME }}
|
||||||
password: ${{ env.REGISTRY_PASSWORD }}
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build Docker image (no buildx)
|
- name: Set up Docker Buildx
|
||||||
run: |
|
uses: docker/setup-buildx-action@v3
|
||||||
# Build using standard docker build (not buildx)
|
with:
|
||||||
cd ${{ github.workspace }}
|
config-inline: |
|
||||||
docker build \
|
[registry."${{ env.REGISTRY }}"]
|
||||||
--no-cache \
|
http = true
|
||||||
--pull \
|
insecure = true
|
||||||
--file ./Backend/Dockerfile \
|
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}:${{ env.IMAGE_TAG }} \
|
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}:latest \
|
|
||||||
.
|
|
||||||
|
|
||||||
echo "✅ Build successful!"
|
- name: Extract metadata
|
||||||
docker images | grep ${{ env.BACKEND_IMAGE_NAME }}
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=sha,prefix=
|
||||||
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: ./Backend
|
||||||
|
file: ./Backend/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Push Docker image
|
- name: Push Docker image
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -62,49 +76,6 @@ jobs:
|
||||||
# Quick test that image can start
|
# Quick test that image can start
|
||||||
docker run --rm ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}:${{ env.IMAGE_TAG }} node --version
|
docker run --rm ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}:${{ env.IMAGE_TAG }} node --version
|
||||||
|
|
||||||
# build:
|
|
||||||
# name: Build Backend Docker Image
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - name: Checkout code
|
|
||||||
# uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# - name: Login to Docker Registry
|
|
||||||
# uses: docker/login-action@v3
|
|
||||||
# with:
|
|
||||||
# registry: ${{ env.REGISTRY }}
|
|
||||||
# username: ${{ env.REGISTRY_USERNAME }}
|
|
||||||
# password: ${{ env.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
# - name: Set up Docker Buildx
|
|
||||||
# uses: docker/setup-buildx-action@v3
|
|
||||||
# with:
|
|
||||||
# config-inline: |
|
|
||||||
# [registry."${{ env.REGISTRY }}"]
|
|
||||||
# http = true
|
|
||||||
# insecure = true
|
|
||||||
|
|
||||||
# - name: Extract metadata
|
|
||||||
# id: meta
|
|
||||||
# uses: docker/metadata-action@v5
|
|
||||||
# with:
|
|
||||||
# images: ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}
|
|
||||||
# tags: |
|
|
||||||
# type=ref,event=branch
|
|
||||||
# type=sha,prefix=
|
|
||||||
# type=raw,value=latest,enable=${{ github.ref == 'refs/heads/dev' }}
|
|
||||||
|
|
||||||
# - name: Build and push Docker image
|
|
||||||
# uses: docker/build-push-action@v5
|
|
||||||
# with:
|
|
||||||
# context: ./Backend
|
|
||||||
# file: ./Backend/Dockerfile
|
|
||||||
# push: true
|
|
||||||
# tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
# labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
# cache-from: type=gha
|
|
||||||
# cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy E-learning Backend to Dev Server
|
name: Deploy E-learning Backend to Dev Server
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue