enable sentry upload (#5329) #798
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: Build Docker image and publish | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: mozilla/blurts-server | |
tags: | | |
type=semver,pattern={{raw}} | |
type=raw,value={{sha}},event=tag | |
- name: Create version.json | |
run: | | |
echo "{\"commit\":\"$GITHUB_SHA\",\"version\":\"$GITHUB_REF\",\"source\":\"https://github.com/$GITHUB_REPOSITORY\",\"build\":\"$GITHUB_RUN_ID\"}" > version.json | |
- name: Check Docker Version | |
run: docker --version | |
- name: Install Latest Docker | |
run: | | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-get install docker-ce | |
- name: Build Docker image | |
env: | |
UPLOAD_SENTRY_SOURCEMAPS: true | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: | | |
docker build --tag blurts-server \ | |
--build-arg SENTRY_RELEASE="$SENTRY_RELEASE" \ | |
--secret id=SENTRY_AUTH_TOKEN \ | |
. | |
- name: Deploy to Dockerhub | |
env: | |
DOCKERHUB_REPO: ${{ env.DOCKERHUB_REPO }} | |
run: | | |
# deploy main | |
docker tag blurts-server ${{ steps.meta.outputs.tags }} | |
docker push ${{ steps.meta.outputs.tags }} | |