fix(docker): allow OPEN_ROUTER_API_KEY to be overwritten #12
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: Build and Push | |
on: | |
push: | |
# tags: ["v*.*.*"] # Match semantic versioning tags like v1.0.0 | |
branches: ["main"] | |
workflow_dispatch: # Allow manual triggering of the workflow | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
# Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Log in to GHCR | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Generate Docker metadata | |
- name: Metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# Cache Docker layers to speed up builds | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-docker-${{ github.ref }} | |
restore-keys: | | |
${{ runner.os }}-docker- | |
# Build and push Docker image | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
id: push | |
with: | |
context: . | |
push: true | |
load: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |