update the workflow 2
Some checks failed
Backend ECR Deployment / build-and-push (push) Failing after 30s
Backend ECR Deployment / notify-deploy (push) Has been skipped
Backend Modal Build / Build & Push via Modal (push) Has been cancelled
Backend Modal Build / notify-deploy (push) Has been cancelled

This commit is contained in:
DatTT127
2026-07-18 18:40:52 +07:00
parent 75a8813999
commit 1546389cae
2 changed files with 51 additions and 55 deletions

View File

@@ -4,8 +4,8 @@
name: Frontend CI/CD
on:
push:
branches: ['**']
# push:
# branches: ['**']
workflow_dispatch: {}
permissions:
@@ -25,62 +25,62 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
mask-password: 'true'
# - name: Login to Amazon ECR Public
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
# with:
# registry-type: public
# mask-password: 'true'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ${{ env.FRONTEND_DIR }}/package-lock.json
# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '20'
# cache: 'npm'
# cache-dependency-path: ${{ env.FRONTEND_DIR }}/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: ./${{ env.FRONTEND_DIR }}
# - name: Install dependencies
# run: npm ci
# working-directory: ./${{ env.FRONTEND_DIR }}
- name: Build frontend (verify)
run: npm run build
working-directory: ./${{ env.FRONTEND_DIR }}
# - name: Build frontend (verify)
# run: npm run build
# working-directory: ./${{ env.FRONTEND_DIR }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}
tags: |
type=ref,event=branch
type=sha,prefix=
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=Lumina MSK Frontend
# - name: Extract metadata for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}
# tags: |
# type=ref,event=branch
# type=sha,prefix=
# type=raw,value=latest,enable={{is_default_branch}}
# labels: |
# org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
# org.opencontainers.image.revision=${{ github.sha }}
# org.opencontainers.image.title=Lumina MSK Frontend
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./${{ env.FRONTEND_DIR }}
file: ./${{ env.FRONTEND_DIR }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: ./${{ env.FRONTEND_DIR }}
# file: ./${{ env.FRONTEND_DIR }}/Dockerfile
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
- name: Image digest
run: echo "Pushed ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ steps.meta.outputs.tags }}"
# - name: Image digest
# run: echo "Pushed ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ steps.meta.outputs.tags }}"
notify-deploy:
needs: build-and-push