Skip to content

Commit

Permalink
feat: update api.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lennoxlotl committed Oct 21, 2024
1 parent dd92eef commit 550c16a
Showing 1 changed file with 36 additions and 32 deletions.
68 changes: 36 additions & 32 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- "main"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
name: Build binary and push (api)
Expand All @@ -24,35 +28,35 @@ jobs:
run: |
echo "SHORT_COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "BRANCH_NAME=$(git branch --show-current)" >> $GITHUB_ENV
- name: Test
run: echo "$MATRIX_TEST"
env:
MATRIX_TEST: ${{ matrix.platform }}
# - name: Build binary
# run: cargo build --release
# - name: Copy binary
# run: mv target/release/api api/api
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Login to repository
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# - name: Build and push
# uses: docker/build-push-action@v3
# with:
# push: true
# platforms: linux/arm64
# context: apps/api
# file: apps/api/Dockerfile
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
- name: Build binary
run: cargo build --release
- name: Copy binary
run: mv target/release/api api/api
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to repository
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.RUNNER_ARCH }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/arm64
context: apps/api
file: apps/api/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
combine:
name: Combine docker manifests
runs-on: ubuntu-22.04
steps:

0 comments on commit 550c16a

Please sign in to comment.