Skip to content

Commit

Permalink
feat(ci): switch to build_docker.sh (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChandonPierre authored Aug 13, 2024
1 parent 2f0c16c commit 8776623
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_ENV

- name: Set HELM_VERSION
run: echo "HELM_VERSION=${{ env.VERSION }}-${GITHUB_SHA::7}" >> $GITHUB_ENV
run: echo "HELM_VERSION=v${{ env.VERSION }}-${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
52 changes: 20 additions & 32 deletions .github/workflows/publish-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,14 @@ jobs:
id: set_version
run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_ENV

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.source="https://github.com/coreweave/tailscale"
tags: |
type=ref,event=branch
type=ref,event=pr
type=schedule
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{ env.VERSION }}
type=raw,value=${{ env.VERSION }}-{{sha}}
- name: Set image tag
run: echo "TAGS=v${{ env.VERSION }}-${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/[email protected]
- name: Set PUSH
run: echo "PUSH=true" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Set PLATFORM
run: echo "PLATFORM=flyio" >> $GITHUB_ENV

- name: Log into registry ghcr.io
uses: docker/[email protected]
Expand All @@ -61,17 +49,17 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: ./
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ env.VERSION }}
tags: ${{ steps.meta.outputs.tags }}
- name: Publish client
shell: bash
run: |
REPOS="ghcr.io/${{ github.repository }}/tailscale" TARGET="client" ./build_docker.sh
- name: Publish k8s-operator
shell: bash
run: |
REPOS="ghcr.io/${{ github.repository }}/k8s-operator" TARGET="operator" ./build_docker.sh
- name: Publish k8s-nameserver
shell: bash
run: |
REPOS="ghcr.io/${{ github.repository }}/k8s-nameserver" TARGET="k8s-nameserver" ./build_docker.sh
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,3 @@ COPY --from=build-env /go/bin/* /usr/local/bin/
# For compat with the previous run.sh, although ideally you should be
# using build_docker.sh which sets an entrypoint for the image.
RUN mkdir /tailscale && ln -s /usr/local/bin/containerboot /tailscale/run.sh

CMD "/usr/local/bin/containerboot"

0 comments on commit 8776623

Please sign in to comment.