Skip to content

Commit

Permalink
Merge pull request #16 from KingPin/patch-1
Browse files Browse the repository at this point in the history
add github flow to build the docker image
  • Loading branch information
AyushSehrawat authored Jul 16, 2024
2 parents 4449235 + e5c19d4 commit 3948188
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/docker-frontend-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Docker Build and Push frontend

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
security-events: write

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

- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v3
id: qemu
with:
platforms: amd64,arm64

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

- name: Log into ghcr.io registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Docker Hub
if: ${{ secrets.DOCKER_HUB_USERNAME && secrets.DOCKER_HUB_ACCESS_TOKEN }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Read VERSION file
id: version
run: echo "VERSION=$(cat VERSION)" >> "$GITHUB_OUTPUT"

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/rivenmedia/riven-frontend:latest
ghcr.io/rivenmedia/riven-frontend:${{ steps.version.outputs.VERSION }}
# docker.io/spoked/riven-frontend:latest
# docker.io/spoked/riven-frontend:${{ steps.version.outputs.VERSION }}

0 comments on commit 3948188

Please sign in to comment.