This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
chore(deps): update devdependencies-major (major) #147
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: Docker CI | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY}} | |
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | |
NEXT_PUBLIC_HUMAN_MODELS_PATH: /models | |
NEXT_PUBLIC_COLORTHIEF_URL: ${{ secrets.NEXT_PUBLIC_COLORTHIEF_URL }} | |
on: | |
push: | |
branches: [main] | |
tags: | |
- "v*" | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
# inputs: | |
# debug_enabled: | |
# description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" | |
# required: false | |
# default: false | |
release: | |
types: [published] | |
jobs: | |
# build-and-push-docker-hub: | |
# runs-on: ubuntu-latest | |
# if: "!contains(github.event.head_commit.message, 'skip ci')" | |
# steps: | |
# - name: Checkout source repository | |
# uses: actions/checkout@v3 | |
# # - name: Set up QEMU | |
# # uses: docker/setup-qemu-action@v2 | |
# # - name: Set up Docker Buildx | |
# # uses: docker/setup-buildx-action@v2 | |
# - name: Docker meta base | |
# id: meta | |
# uses: docker/metadata-action@v4 | |
# with: | |
# images: ${{ env.IMAGE_NAME }} | |
# tags: | | |
# type=ref,event=branch | |
# type=ref,event=pr | |
# type=semver,pattern={{version}} | |
# type=semver,pattern={{major}}.{{minor}} | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_PASSWORD }} | |
# - name: Build base | |
# uses: docker/build-push-action@v3 | |
# with: | |
# # load: true | |
# # platforms: linux/amd64,linux/arm64 | |
# context: . | |
# file: ./Dockerfile | |
# push: ${{ github.event_name != 'pull_request' }} | |
# tags: ${{ steps.meta_base.outputs.tags }} | |
# labels: ${{ steps.meta_base.outputs.labels }} | |
build-and-push-ghcr: | |
env: | |
REGISTRY: ghcr.io | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker image | |
id: metaghcr | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build base and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
NEXT_PUBLIC_SUPABASE_ANON_KEY=${{ env.NEXT_PUBLIC_SUPABASE_ANON_KEY }} | |
NEXT_PUBLIC_SUPABASE_URL=${{ env.NEXT_PUBLIC_SUPABASE_URL }} | |
NEXT_PUBLIC_HUMAN_MODELS_PATH=${{ env.NEXT_PUBLIC_HUMAN_MODELS_PATH }} | |
NEXT_PUBLIC_COLORTHIEF_URL=${{ env.NEXT_PUBLIC_COLORTHIEF_URL }} | |
context: . | |
file: ./Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.metaghcr.outputs.tags }} | |
labels: ${{ steps.metaghcr.outputs.labels }} |