-
Notifications
You must be signed in to change notification settings - Fork 16
57 lines (50 loc) · 1.59 KB
/
deploy-proxy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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