From 3a133ced248207164a43f837afe73735cc3f850d Mon Sep 17 00:00:00 2001 From: Curly <36010519+neon-JS@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:53:33 +0100 Subject: [PATCH] chore: Updated GitHub workflows - Maybe image is broken bc of long build times? - Trying splitting the workflows --- .../{docker.yml => docker_linux_amd64.yml} | 6 +- .github/workflows/docker_linux_arm64.yml | 97 +++++++++++++++++++ .github/workflows/rust.yml | 2 +- 3 files changed, 101 insertions(+), 4 deletions(-) rename .github/workflows/{docker.yml => docker_linux_amd64.yml} (96%) create mode 100644 .github/workflows/docker_linux_arm64.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker_linux_amd64.yml similarity index 96% rename from .github/workflows/docker.yml rename to .github/workflows/docker_linux_amd64.yml index 7a40bc2..b04c463 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker_linux_amd64.yml @@ -1,4 +1,4 @@ -name: Docker +name: Docker build & publish (linux/amd64) on: push: @@ -52,7 +52,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - platforms: linux/amd64,linux/arm64/v8 + platforms: linux/amd64 build-frontend: runs-on: ubuntu-latest permissions: @@ -94,4 +94,4 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - platforms: linux/amd64,linux/arm64/v8 \ No newline at end of file + platforms: linux/amd64 \ No newline at end of file diff --git a/.github/workflows/docker_linux_arm64.yml b/.github/workflows/docker_linux_arm64.yml new file mode 100644 index 0000000..4fbbce6 --- /dev/null +++ b/.github/workflows/docker_linux_arm64.yml @@ -0,0 +1,97 @@ +name: Docker build & publish (linux/arm64/v8) + +on: + push: + branches: [ "main" ] + tags: [ 'v*.*.*' ] + schedule: + - cron: "25 1 * * 1" + +env: + REGISTRY: ghcr.io + +jobs: + build-backend: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + defaults: + run: + working-directory: backend + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@v3.4.0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/neon-JS/above_me-backend + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v5 + with: + context: backend + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/arm64/v8 + build-frontend: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + defaults: + run: + working-directory: frontend + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@v3.4.0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/neon-JS/above_me-frontend + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v5 + with: + context: frontend + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/arm64/v8 \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 029395d..9afde97 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Rust +name: Cargo build & test on: push: