Skip to content

feat: add Docker build workflow and Dockerfile; update application pr… #1

feat: add Docker build workflow and Dockerfile; update application pr…

feat: add Docker build workflow and Dockerfile; update application pr… #1

name: Build and Push Backend Docker Image
on:
push:
branches:
- main
paths:
- 'backend/**'
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: ghcr.io/dnigamer/campuspass-backend:latest