Add screenshot, update Logo & more #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to GitHub Container Registry and Docker Hub | |
on: | |
push: | |
paths-ignore: | |
- '.github/**' | |
- 'assets/**' | |
- '.gitignore' | |
- '.devcontainer.json' | |
- 'docker-compose.yml' | |
- 'eslint.config.mjs' | |
- 'LICENSE' | |
- 'package-lock.json' | |
- 'package.json' | |
- 'README.md' | |
branches: ["main"] | |
pull_request: | |
paths-ignore: | |
- '.github/**' | |
- 'assets/**' | |
- '.gitignore' | |
- '.devcontainer.json' | |
- 'eslint.config.mjs' | |
- 'LICENSE' | |
- 'package-lock.json' | |
- 'package.json' | |
- 'README.md' | |
branches: ["main"] | |
env: | |
REGISTRY_GHCR: ghcr.io | |
REGISTRY_DOCKERHUB: docker.io | |
COMMIT_HASH: ${{ github.sha }} | |
jobs: | |
build_and_push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
- name: Convert repository name to lowercase | |
id: vars | |
run: echo "REPO_NAME_LOWER=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v1 | |
with: | |
images: | | |
${{ env.REGISTRY_GHCR }}/${{ env.REPO_NAME_LOWER }} | |
${{ env.REGISTRY_DOCKERHUB }}/${{ env.REPO_NAME_LOWER }} | |
- name: Build Docker image without push | |
id: build-image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: false | |
tags: | | |
${{ env.COMMIT_HASH }} | |
latest | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Log into GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY_GHCR }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Docker image to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ env.REGISTRY_GHCR }}/${{ env.REPO_NAME_LOWER }}:${{ env.COMMIT_HASH }} | |
${{ env.REGISTRY_GHCR }}/${{ env.REPO_NAME_LOWER }}:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Log into Docker Hub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY_DOCKERHUB }} | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push Docker image to Docker Hub | |
if: github.event_name != 'pull_request' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ env.REGISTRY_DOCKERHUB }}/${{ env.REPO_NAME_LOWER }}:${{ env.COMMIT_HASH }} | |
${{ env.REGISTRY_DOCKERHUB }}/${{ env.REPO_NAME_LOWER }}:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |