Skip to content

Commit 5be4bc9

Browse files
authored
Merge pull request #6 from NREL/actions_build
Continuous Building of Image
2 parents 85cc75d + de2761d commit 5be4bc9

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build for Development
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
release:
8+
types: [released]
9+
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
14+
jobs:
15+
build-image:
16+
name: Build image
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 20
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v3
22+
23+
- name: Log into container registry
24+
uses: docker/login-action@v2
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Docker meta
31+
uses: docker/metadata-action@v4
32+
id: meta
33+
with:
34+
images: |
35+
${{ env.REGISTRY }}/${{ github.repository }}
36+
tags: |
37+
type=ref,event=branch
38+
type=sha
39+
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
40+
type=semver,pattern={{major}},enable=${{ github.event_name == 'release' }}
41+
42+
- name: Build and push
43+
uses: docker/build-push-action@v4
44+
with:
45+
context: .
46+
push: true
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.output.labels }}

0 commit comments

Comments
 (0)