-
Notifications
You must be signed in to change notification settings - Fork 11
33 lines (26 loc) · 923 Bytes
/
build-push.yaml
File metadata and controls
33 lines (26 loc) · 923 Bytes
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
name: Build and Push Container
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Login to github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and tag latest docker image
run: |
docker build -f Dockerfile -t ghcr.io/${{ github.repository_owner }}/nuts:$GITHUB_SHA .
- name: Tag versioned image
run: docker tag ghcr.io/${{ github.repository_owner }}/nuts:$GITHUB_SHA ghcr.io/${{ github.repository_owner }}/nuts:latest
- name: Push the images
run: |
docker push ghcr.io/${{ github.repository_owner }}/nuts:latest
docker push ghcr.io/${{ github.repository_owner }}/nuts:$GITHUB_SHA