From dd83c25a504f31b673ee6b8ef81984b6797fbfe4 Mon Sep 17 00:00:00 2001 From: Felix Faerber Date: Wed, 27 May 2026 10:09:41 +0300 Subject: [PATCH] create image --- .github/workflows/docker.yml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..6c24fa9 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,47 @@ +name: Docker Image + +on: + push: + branches: [main, develop] + pull_request: + branches: [main] + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/metadata-action@v5 + id: meta + with: + images: ghcr.io/token-for-token/hosted-gateway + tags: | + type=sha + type=ref,event=branch + type=raw,value=latest,enable={{is_default_branch}} + labels: | + org.opencontainers.image.source=https://github.com/token-for-token/hosted-gateway + + - uses: docker/build-push-action@v6 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + COMMIT_SHA=${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max