Skip to content

Commit 961a99f

Browse files
chore: add workflow to build action image (#16)
1 parent 5f8eb16 commit 961a99f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Docker Image CI
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Build the Docker image
18+
run: docker build . --file Dockerfile --tag localhost/utp:dev-${{github.run_number}}
19+
- name: Authenticate with GHCR
20+
if: github.event_name == 'release'
21+
uses: docker/login-action@v2.1.0
22+
with:
23+
registry: ghcr.io
24+
username: greentf
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
- name: Push container
27+
if: github.event_name == 'release'
28+
run: docker push localhost/utp:dev-${{github.run_number}} ghcr.io/greentf/utp:latest

0 commit comments

Comments
 (0)