37 lines
923 B
YAML
37 lines
923 B
YAML
name: Publish to Docker Hub
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
name: Build & Push All-in-one Image
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: production
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: Dockerfile.allinone
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKERHUB_USERNAME }}/condado-newsletter:latest
|
|
${{ secrets.DOCKERHUB_USERNAME }}/condado-newsletter:${{ github.sha }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|