Skip to content

Commit

Permalink
Build and Push to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-smith committed Apr 8, 2024
1 parent 0b78b16 commit a744263
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Push Docker Images

on:
push:
branches:
- main

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

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Backend Docker Image
uses: docker/build-push-action@v3
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/backend:latest

- name: Build and Push Frontend Docker Image
uses: docker/build-push-action@v3
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/frontend:latest

0 comments on commit a744263

Please sign in to comment.