mirror of
https://github.com/p-stream/backend.git
synced 2026-04-19 14:32:05 +00:00
32 lines
821 B
YAML
32 lines
821 B
YAML
# .github/workflows/docker-publish.yml
|
|
name: Build and Publish Docker image to GHCR
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ] # Change to your default branch
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t ghcr.io/${{ github.repository_owner }}/backend:latest .
|
|
- name: Push Docker image
|
|
run: |
|
|
docker push ghcr.io/${{ github.repository_owner }}/backend:latest
|