-
Notifications
You must be signed in to change notification settings - Fork 30
66 lines (57 loc) · 1.8 KB
/
Copy pathbuild.yml
File metadata and controls
66 lines (57 loc) · 1.8 KB
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
61
62
63
64
65
66
name: Container Build
on:
release:
types: [published] # Triggered when a release is published
workflow_dispatch: # Allows manual trigger
schedule:
- cron: '0 8 * * *' # 3:00 AM ET during Standard Time (UTC-5)
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up QEMU for cross-platform builds
uses: docker/setup-qemu-action@v4
with:
platforms: 'linux/amd64,linux/arm64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image for releases
if: github.event_name == 'release' && github.event.action == 'published'
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
jeffersonlab/japan-moller:latest
jeffersonlab/japan-moller:${{ github.ref_name }}
- name: Build and push Docker image for nightly build
if: github.event_name == 'schedule'
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
jeffersonlab/japan-moller:nightly
- name: Build and push Docker image for manual trigger on main branch
if: github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
jeffersonlab/japan-moller:main