Skip to content

Commit

Permalink
chore: Updated GitHub workflows
Browse files Browse the repository at this point in the history
- Maybe image is broken bc of long build times?
  - Trying splitting the workflows
  • Loading branch information
its-laika committed Mar 25, 2024
1 parent aeb1e31 commit 3a133ce
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker
name: Docker build & publish (linux/amd64)

on:
push:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
platforms: linux/amd64
97 changes: 97 additions & 0 deletions .github/workflows/docker_linux_arm64.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Cargo build & test

on:
push:
Expand Down

0 comments on commit 3a133ce

Please sign in to comment.