Skip to content

Hide the diagnostic component when not in Developer mode #89

Hide the diagnostic component when not in Developer mode

Hide the diagnostic component when not in Developer mode #89

Workflow file for this run

name: Create Docker image
on:
push:
branches: [ "main" ]
paths:
- 'src/**'
- '.github/**'
pull_request:
branches: [ "main" ]
paths:
- 'src/**'
- '.github/**'
env:
REGISTRY: ghcr.io
OWNER: ${{ github.repository_owner }}
# API_IMAGE: openwish-api
WEB_IMAGE: openwish-web
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get the current date and time
id: date
run: echo "::set-output name=date::$(date +'%Y.%m')"
- name: Get the short SHA
id: git_sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker metadata for Web
id: meta-web
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.WEB_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=sha,format=short,enable={{is_default_branch}}
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{date 'YYYY'}}{{date 'MM'}},enable={{is_default_branch}}
- name: Build and push Web image
uses: docker/build-push-action@v5
with:
context: ./src
file: ./src/OpenWish.Web/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-web.outputs.tags }}
labels: ${{ steps.meta-web.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILD_VERSION=${{ steps.date.outputs.date }}
GIT_SHA=${{ steps.git_sha.outputs.sha }}