Skip to content

Merge pull request #157 from ddxv/main #18

Merge pull request #157 from ddxv/main

Merge pull request #157 from ddxv/main #18

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Publish Docker Image Dash Backend
on:
# TODO: Should use releases instead of push?
# release:
# types: [published]
push:
branches: ['main']
paths:
- 'apps/dash-backend/**'
- '.github/workflows/actions-docker-build-dash-backend.yml'
# Publish semver tags as releases.
tags: ['v*.*.*']
jobs:
push_to_registry:
if: github.repository_owner == 'OpenAttribution'
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
environment: production
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: openattribution
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: openattribution/dash-backend
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: apps/dash-backend/
file: apps/dash-backend/Dockerfile.build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}