Merge branch 'main' of github.com:catalyst-cooperative/mozilla-sec-eia #5
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: docker-build-push | |
on: [push, pull_request] | |
jobs: | |
push_to_registry: | |
name: Build Docker image and push to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Docker Metadata | |
id: docker_metadata | |
uses: docker/[email protected] | |
with: | |
images: catalystcoop/mozilla-sec-eia-docker-build-push | |
flavor: | | |
latest=auto | |
tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image and push to Docker Hub | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: docker/Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.docker_metadata.outputs.tags }} | |
labels: ${{ steps.docker_metadata.outputs.labels }} |