Skip to content
name: Create and publish Docker image to GHCR
on:
release:
types: [published]
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the 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: "{{defaultContext}}:frontend"
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ghcr.io/nismod/jsrat-frontend:${{ github.ref_name }}
secrets: |
GH_TOKEN=${{ secrets.GITHUB_TOKEN }}