31 lines
729 B
YAML
31 lines
729 B
YAML
name: Build and Push to GitHub Container Registry
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
release:
|
|
types: [published]
|
|
|
|
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
|
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
|
|
|
- name: Build Docker Image
|
|
run: |
|
|
docker build -t ghcr.io/${{ github.actor }}/booklore-app:latest .
|
|
|
|
- name: Push Docker Image to GHCR
|
|
run: |
|
|
docker push ghcr.io/${{ github.actor }}/booklore-app:latest |