|
1 | 1 | name: Build image
|
2 | 2 |
|
| 3 | +permissions: read-all |
| 4 | + |
3 | 5 | on:
|
4 | 6 | push:
|
5 |
| - branches: ["main"] |
| 7 | + branches: [ "master" ] |
6 | 8 | tags:
|
7 |
| - - v[0-9]+.[0-9]+.[0-9]+ # Semver Release (non-prerelease) |
| 9 | + - 'v*.*.*' # glob for semver tags (including prereleases) |
8 | 10 | pull_request:
|
9 |
| - branches: [main] |
| 11 | + branches: [ master ] |
10 | 12 |
|
11 | 13 | jobs:
|
12 |
| - docker: |
13 |
| - runs-on: ubuntu-latest |
14 |
| - steps: |
15 |
| - - name: Checkout |
16 |
| - uses: actions/checkout@v3 |
17 |
| - with: |
18 |
| - submodules: "recursive" |
19 |
| - - name: Docker meta |
20 |
| - id: meta |
21 |
| - uses: docker/metadata-action@v5 |
22 |
| - with: |
23 |
| - images: hub.opensciencegrid.org/macrostrat/web |
24 |
| - # New: apply the 'latest' tag to non-prerelease semver tags |
25 |
| - tags: | |
26 |
| - type=raw,value=sha-{{sha}} |
27 |
| - type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')}} |
28 |
| - type=raw,value=latest-itb,enable=${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')}} |
29 |
| - type=raw,value=latest-,suffix={{date 'YYYYMMDDHHmmss'}},enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')}} |
30 |
| - type=raw,value=latest-itb-,suffix={{date 'YYYYMMDDHHmmss'}} |
31 |
| - type=ref,event=pr |
32 |
| - type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmmss'}} |
33 |
| - type=semver,pattern={{version}} |
34 |
| - flavor: | |
35 |
| - latest=false |
36 |
| - - name: Set up Docker BuildX |
37 |
| - uses: docker/setup-buildx-action@v2 |
38 |
| - - name: Login to OSG DockerHub |
39 |
| - uses: docker/login-action@v2 |
40 |
| - with: |
41 |
| - registry: hub.opensciencegrid.org |
42 |
| - username: ${{ vars.HARBOR_CLI_NAME }} |
43 |
| - password: ${{ secrets.HARBOR_CLI_SECRET }} |
44 |
| - - name: Build and push |
45 |
| - uses: docker/build-push-action@v5 |
46 |
| - with: |
47 |
| - context: . |
48 |
| - push: true |
49 |
| - tags: ${{ steps.meta.outputs.tags }} |
50 |
| - labels: ${{ steps.meta.outputs.labels }} |
51 |
| - cache-from: type=gha |
52 |
| - cache-to: type=gha,mode=max |
| 14 | + call-build-image: |
| 15 | + uses: UW-Macrostrat/build-push/.github/workflows/build-push.yaml@main |
| 16 | + secrets: inherit |
| 17 | + with: |
| 18 | + context: . |
| 19 | + image: 'hub.opensciencegrid.org/macrostrat/rockd-website' |
0 commit comments