From 7fa9eda6aa829a1f3c30b4426520148ac8a3b6b5 Mon Sep 17 00:00:00 2001 From: Aisuko Date: Mon, 1 Jul 2024 11:59:35 +0000 Subject: [PATCH] Support arm64 Signed-off-by: Aisuko --- .dockerignore | 2 + .github/dependabot.yml | 5 +- .github/workflows/ci.yml | 68 +++++++++++++++++++++++---- .github/workflows/release-drafter.yml | 2 +- README.md | 6 +-- 5 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1a51de4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.gitignore +.git/ \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7530dd9..4d68d6c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,6 @@ updates: - package-ecosystem: "npm" # See documentation for possible values directory: "/" # Location of package manifests schedule: - interval: "weekly" + interval: "monthly" open-pull-requests-limit: 10 - reviewers: - - Wen-ace + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19da176..2ce0de3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,14 +9,21 @@ on: branches: - 'main' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} + cancel-in-progress: true jobs: build: name: 'Build 🏗️' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Nodes + uses: actions/setup-node@v4 with: node-version: '18' - name: Install dependencies @@ -37,9 +44,23 @@ jobs: docker_operations: name: 'Docker Build and Push🐳' runs-on: ubuntu-latest - needs: build + needs: [build] + strategy: + matrix: + config: + - { dockerfile: "Dockerfile", platforms: "linux/amd64,linux/arm64" } + steps: - - uses: actions/checkout@v4 + + - name: Check repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Github Container Registry uses: docker/login-action@v3 if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() @@ -47,12 +68,41 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Commit Hash + id: commit + shell: bash + run: | + echo "SHORT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + + - name: Get Tag Name + id: tag + shell: bash + run: | + echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + - name: Build Docker image if: startsWith(github.ref, 'refs/tags/') != true && success() - run: | - docker build -t ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7} . + uses: docker/build-push-action@v4 + with: + context: . + push: false + platforms: ${{ matrix.config.platforms }} + tags: "ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${{ env.SHORT_HASH }}" + file: ${{ matrix.config.dockerfile }} + + # run: | + # docker build -t ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7} . - name: Push Docker image if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() - run: | - docker build -t ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} . - docker push ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} + uses: docker/build-push-action@v4 + with: + context: . + push: true + platforms: ${{ matrix.config.platforms }} + tags: "ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${{ env.TAG }}" + file: ${{ matrix.config.dockerfile }} + + # run: | + # docker build -t ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} . + # docker push ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 342eb46..970e6e8 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml with: config-name: release-drafter.yml diff --git a/README.md b/README.md index aaae99d..ab3189b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ +# Rebel -[![Release Drafter 🚀](https://github.com/SkywardAI/chat-frontend/actions/workflows/release-drafter.yml/badge.svg)](https://github.com/SkywardAI/chat-frontend/actions/workflows/release-drafter.yml) +Frontend for AI-pilot chatbot -# Nuxt 3 Minimal Starter +[![Rebel CI/CD 🚀](https://github.com/SkywardAI/chat-frontend/actions/workflows/ci.yml/badge.svg)](https://github.com/SkywardAI/chat-frontend/actions/workflows/ci.yml) [![Release Drafter 🚀](https://github.com/SkywardAI/chat-frontend/actions/workflows/release-drafter.yml/badge.svg)](https://github.com/SkywardAI/chat-frontend/actions/workflows/release-drafter.yml) -Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. ## Setup