Skip to content

Commit

Permalink
feat: docker build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
mansaj committed Feb 14, 2024
1 parent 7613ef3 commit b51028f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker_build_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build Docker image and publish

on:
push:
branches: [ main, MNTOR-2247 ]
tags: '*'
pull_request:
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=cicd-{{branch}}-{{sha}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit b51028f

Please sign in to comment.