Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/maybeanerd/booktracker. a multi platform application and server to track your book reading journey
hacktoberfest
Something went wrong. Try again.
1.4 kB · 53 lines
YAML
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354name: Docker
on: pull_request: release: types: [published]
permissions: contents: read packages: write
jobs: build-backend: name: Build Backend Docker Image runs-on: ubuntu-latest
steps: - name: Checkout repository uses: actions/checkout@v6
- name: Set up Docker Buildx uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry if: github.event_name == 'release' uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata id: meta uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository }}/backend tags: | type=ref,event=branch type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=sha
- name: Build and push uses: docker/build-push-action@v6 with: context: . file: ./apps/backend/Dockerfile push: ${{ github.event_name == 'release' || github.event_name == 'push' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max