Skip to content
This repository was archived by the owner on May 24, 2025. It is now read-only.

Commit b3a1b4c

Browse files
authored
Merge pull request #7 from sers-dev/#6GithubWorkflowImage
#6: added github workflow file
2 parents 7a08f3c + 30ef1fd commit b3a1b4c

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Build container image"
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- 'main'
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v2
27+
28+
# Login against a Docker registry except on PR
29+
# https://github.com/docker/login-action
30+
- name: Log into registry ${{ env.REGISTRY }}
31+
if: github.event_name != 'pull_request'
32+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
# Extract metadata (tags, labels) for Docker
39+
# https://github.com/docker/metadata-action
40+
- name: Extract Docker metadata
41+
id: meta
42+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
43+
with:
44+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45+
46+
# Build and push Docker image with Buildx (don't push on PR)
47+
# https://github.com/docker/build-push-action
48+
- name: Build and push Docker image
49+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
50+
with:
51+
context: .
52+
file: ./docker/Dockerfile
53+
push: ${{ github.event_name != 'pull_request' }}
54+
tags: ${{ steps.meta.outputs.tags }}
55+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
go.sum
33
main
4+
vendor

docker/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.3'
22
services:
33
dovecot-director-controller:
4-
image: angylada/dovecot-director-controller:latest
4+
image: "ghcr.io/sers-dev/dovecot-director-controller:latest"
55
build:
66
context: ../
77
dockerfile: ./docker/Dockerfile

0 commit comments

Comments
 (0)