Update README.md #15
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: Publish container | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main"] | |
tags: | |
- "v*.*.*" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
login: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Method 1 | |
# - | |
# name: Docker Build and Push | |
# continue-on-error: true | |
# run: | | |
# docker build . --tag ghcr.io/ntxinh/aspnetcore-ddd:latest | |
# docker push ghcr.io/ntxinh/aspnetcore-ddd:latest | |
# Method 2 | |
- | |
name: Docker Build and Push by Action | |
# continue-on-error: true | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: ghcr.io/ntxinh/aspnetcore-ddd:latest | |
# Method 3: | |
# - | |
# name: Docker Build and Push by Docker Compose | |
# continue-on-error: true | |
# run: | | |
# docker compose build | |
# docker compose push |