Merge pull request #5 from will-bank/growthbook-proxy-custom #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 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' }} | |
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: Build, tag, and push image to Docker Hub | |
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 | |
# Build and push the docker image | |
docker build -t growthbook/proxy:latest -t growthbook/proxy:git-${GITHUB_SHA::7} . | |
docker push -a growthbook/proxy |