Skip to content

Commit bbb83ce

Browse files
committed
Added github actions to build and push container.
1 parent 13e55b0 commit bbb83ce

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/container.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and publish Docker image
2+
3+
# On every pull request, but only on push to main
4+
on:
5+
push:
6+
branches:
7+
- feature/container-build-n-push
8+
tags:
9+
- '*'
10+
pull_request:
11+
workflow_dispatch:
12+
13+
env:
14+
LATEST_PY_VERSION: '3.11'
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v2
26+
27+
- name: Log in to GitHub Container Registry
28+
uses: docker/login-action@v2
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Build Docker image
35+
run: |
36+
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
37+
38+
- name: Push Docker image
39+
run: |
40+
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}

0 commit comments

Comments
 (0)