Skip to content

Commit

Permalink
Create docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
arslankhanali authored Jul 20, 2024
1 parent d7be8f6 commit 2988a40
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and Push Docker Images

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push backend image
uses: docker/build-push-action@v5
with:
context: .
file: skupper-app/backend/Containerfile
push: true
tags: quay.io/arslankhanali/skupper-backend:latest-gh
platforms: linux/amd64,linux/arm64,linux/ppc64le
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Build and push frontend image
uses: docker/build-push-action@v5
with:
context: .
file: skupper-app/frontend/Containerfile
push: true
tags: quay.io/arslankhanali/skupper-frontend:latest-gh
platforms: linux/amd64,linux/arm64,linux/ppc64le
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Logout from Quay.io
run: docker logout quay.io

0 comments on commit 2988a40

Please sign in to comment.