Skip to content

Use depot for multi-platform builds (#77) #51

Use depot for multi-platform builds (#77)

Use depot for multi-platform builds (#77) #51

Workflow file for this run

name: "Proxy: deploy"
on:
# Push to the main branch
push:
branches:
- main
jobs:
# Build and publish the commit to docker
docker:
runs-on: ubuntu-latest
if: ${{ github.repository == 'growthbook/growthbook-proxy' }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Install Depot CLI
uses: depot/setup-action@v1
- name: Prepare build metadata
id: metadata
run: |
# Store current git hash and date in files
mkdir -p buildinfo
echo "${GITHUB_SHA}" > buildinfo/SHA
printf '%(%Y-%m-%dT%H:%M:%SZ)T' > buildinfo/DATE
echo "docker_sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
# If this is a tag, echo tag to output
tag=$(git tag --points-at HEAD)
if [ -n "$tag" ]; then
echo "tag=growthbook/proxy:$tag" >> $GITHUB_OUTPUT
else
echo "tag=" >> $GITHUB_OUTPUT
fi
- name: Build, tag, and push image to Docker Hub
uses: depot/build-push-action@v1
with:
push: true
context: .
project: rrh2d9pr3p
tags: |
growthbook/proxy:latest
growthbook/proxy:git-${{ steps.metadata.outputs.docker_sha }}
${{ steps.metadata.outputs.tag }}
platforms: linux/amd64,linux/arm64