Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Add expired logi badge #127

Add expired logi badge

Add expired logi badge #127

name: Docker Frontend
on:
push:
branches: [ main, dev ]
paths: [ 'frontend/**', '.github/workflows/docker-frontend.yml' ]
workflow_dispatch:
env:
COMPONENT: frontend
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Docker Login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- uses: actions/checkout@v3
- name: Docker Build
working-directory: ./frontend
run: docker build -t $COMPONENT .
- name: Docker Push
run: |
IMAGE_URL=ghcr.io/${{ github.repository }}
IMAGE_URL=$(echo $IMAGE_URL | tr '[A-Z]' '[a-z]')
# Strip "v" prefix from tag name
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
docker tag $COMPONENT $IMAGE_URL-$COMPONENT:$VERSION
docker push $IMAGE_URL-$COMPONENT:$VERSION