-
Notifications
You must be signed in to change notification settings - Fork 48
60 lines (45 loc) · 1.51 KB
/
docker.yml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Push Docker image to GitHub Pack Registry
on:
push:
# Publish `main` as Docker `latest` image.
branches:
- development
# Publish `v1.2.3` tags as releases.
# tags:
# Run tests for any PRs.
pull_request:
# Allow running this action on demand
workflow_dispatch:
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
jobs:
build-and-push-docker-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Print triggering event info
run: |
echo "${{ github.actor }} triggered run #${{ github.run_number }} with event type ${{ github.event_name }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_NREL_USER }}
password: ${{ secrets.DOCKERHUB_NREL_TOKEN }}
- name: Login to GitHub Package Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
nrel/bifacial_radiance:latest
ghcr.io/nrel/bifacial_radiance:latest