Skip to content

Commit

Permalink
Add CI step to build and push images to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 9, 2025
1 parent 2038335 commit 0118494
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all
- uses: actions/checkout@v3
- name: Put back the git branch into git (Earthly uses it for tagging)
run: |
Expand All @@ -67,6 +73,10 @@ jobs:
--RELEASE_VERSION=${GITHUB_REF:10} \
--GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker images
run: |
earthly --ci +multi-image --RELEASE_VERSION=${GITHUB_REF:10}
- name: Put back the git branch into git (Earthly uses it for tagging)
run: |
branch=""
Expand Down
8 changes: 6 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ image:
ENV NODE_ENV=production
ENV ALLOW_PORTS=8000-29999
COPY +build/build /app/build
RUN ls -al /app/build
ENTRYPOINT ["/app/build/frp-port-keeper"]
SAVE IMAGE --push ${TARGET_DOCKER_REGISTRY}/frp-port-keeper:$RELEASE_VERSION

multi-image:
BUILD --platform=linux/amd64 --platform=linux/arm64 +build
ARG RELEASE_VERSION=latest
# Since oven/bun supply only the linux/amd64 and linux/arm64 platform images,
# we build only for them.
BUILD --platform=linux/amd64 --platform=linux/arm64 \
+image \
--RELEASE_VERSION=${RELEASE_VERSION}

multi-build:
FROM +install
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,5 @@ The response body will be a JSON with the following structure:
- [ ] Implement proper logging system
- [ ] Pass `allow_ports` param via cli
- [x] Cross compile for other platforms (currently supports only amd64)
- [ ] Build docker images for other platforms (currently supports only linux/amd64 and linux/arm64)
- [ ] Update systemd files and instructions to run the plugin as systemd service

0 comments on commit 0118494

Please sign in to comment.