mirror of
https://github.com/p-stream/backend.git
synced 2026-03-11 09:45:34 +00:00
Some checks failed
Build and Publish Docker image to GHCR / build-and-push (push) Has been cancelled
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
# .github/workflows/docker-publish.yml
|
|
name: Build and Publish Docker image to GHCR
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ] # Change to your default branch
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
|
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 -t ghcr.io/${{ github.repository_owner }}/backend:${{ github.sha }} .
|
|
- name: Push Docker image
|
|
run: |
|
|
docker push ghcr.io/${{ github.repository_owner }}/backend:latest
|
|
docker push ghcr.io/${{ github.repository_owner }}/backend:${{ github.sha }}
|