Skip to content

Commit 17fe0a6

Browse files
authored
Merge branch 'master' into feat/proxy-dispatch-no-proxy-logs
2 parents 1a41e5c + 573a90c commit 17fe0a6

File tree

6 files changed

+223
-71
lines changed

6 files changed

+223
-71
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Docker Build and Push
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
push:
10+
# branches: [ "main" ]
11+
# Publish semver tags as releases.
12+
tags: [ 'v*.*.*' ]
13+
paths-ignore:
14+
- 'docs/**'
15+
16+
env:
17+
# Use docker.io for Docker Hub if empty
18+
REGISTRY: ghcr.io
19+
# github.repository as <account>/<repo>
20+
#IMAGE_NAME: ${{ github.repository }}
21+
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
packages: write
29+
# This is used to complete the identity challenge
30+
# with sigstore/fulcio when running outside of PRs.
31+
id-token: write
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
- name: Set version
38+
id: version
39+
run: |
40+
mkdir -p handlers
41+
echo ${GITHUB_REF#refs/tags/v} > handlers/VERSION
42+
43+
# Install the cosign tool except on PR
44+
# https://github.com/sigstore/cosign-installer
45+
- name: Install cosign
46+
if: github.event_name != 'pull_request'
47+
uses: sigstore/cosign-installer@main
48+
- name: Set up QEMU
49+
uses: docker/setup-qemu-action@v2
50+
with:
51+
platforms: 'arm64,amd64'
52+
53+
# Workaround: https://github.com/docker/build-push-action/issues/461
54+
- name: Setup Docker buildx
55+
uses: docker/setup-buildx-action@v2
56+
57+
# Login against a Docker registry except on PR
58+
# https://github.com/docker/login-action
59+
- name: Log into registry ${{ env.REGISTRY }}
60+
if: github.event_name != 'pull_request'
61+
uses: docker/login-action@v2
62+
with:
63+
registry: ${{ env.REGISTRY }}
64+
username: ${{ github.actor }}
65+
password: ${{ secrets.GITHUB_TOKEN }}
66+
67+
# Extract metadata (tags, labels) for Docker
68+
# https://github.com/docker/metadata-action
69+
- name: Extract Docker metadata
70+
id: meta
71+
uses: docker/metadata-action@v4
72+
with:
73+
github-token: ${{ secrets.GITHUB_TOKEN }}
74+
images: ${{ env.REGISTRY }}/${{ github.repository }}
75+
tags: |
76+
type=semver,pattern=v{{version}}
77+
type=semver,pattern=v{{major}}.{{minor}}
78+
type=semver,pattern=v{{major}}
79+
80+
# Build and push Docker image with Buildx (don't push on PR)
81+
# https://github.com/docker/build-push-action
82+
- name: Build and push Docker image
83+
id: build-and-push
84+
uses: docker/build-push-action@v3
85+
with:
86+
context: .
87+
push: ${{ github.event_name != 'pull_request' }}
88+
tags: ${{ steps.meta.outputs.tags }}
89+
platforms: linux/amd64,linux/arm64
90+
labels: ${{ steps.meta.outputs.labels }}
91+

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ EXPOSE 4141
2020
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
2121
CMD wget --spider -q http://localhost:4141/ || exit 1
2222

23-
ARG GH_TOKEN
24-
ENV GH_TOKEN=$GH_TOKEN
25-
26-
ENTRYPOINT ["bun", "run", "dist/main.js"]
27-
CMD ["start", "-g", "$GH_TOKEN"]
23+
COPY entrypoint.sh /entrypoint.sh
24+
RUN chmod +x /entrypoint.sh
25+
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)