Merge pull request #157 from ddxv/main #18
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
# 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 }} |