Skip to content

Commit 3db714c

Browse files
committed
Add build
1 parent bf69d86 commit 3db714c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/main.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Create and publish the Docker image
3+
4+
on:
5+
push:
6+
branches: ['master']
7+
8+
env:
9+
IMAGE_NAME: ghcr.io/eokoe/email-db-service
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
22+
- name: Login to Github Container Registry
23+
uses: docker/login-action@v2
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v1
31+
32+
- name: Build and push
33+
uses: docker/build-push-action@v2
34+
with:
35+
context: ./
36+
file: ./Dockerfile
37+
push: true
38+
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ github.sha }}
39+
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
40+
cache-to: type=inline

0 commit comments

Comments
 (0)