-
Notifications
You must be signed in to change notification settings - Fork 145
52 lines (45 loc) · 1.25 KB
/
container.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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