|
8 | 8 | - "docs/**" |
9 | 9 | - "release/**" |
10 | 10 | - "OWNERS" |
11 | | - pull_request_target: |
12 | | - branches: |
13 | | - - main |
14 | | - paths-ignore: |
15 | | - - "docs/**" |
16 | | - - "release/**" |
17 | | - - "OWNERS" |
18 | | - issue_comment: |
19 | | - types: [created] |
| 11 | + workflow_dispatch: |
20 | 12 |
|
21 | 13 | env: |
22 | | - REGISTRY: ${{ github.event_name == 'pull_request' && 'ghcr.io' || 'docker.io' }} |
23 | | - ORG: ${{ github.event_name == 'pull_request' && github.repository || 'nephio' }} |
| 14 | + REGISTRY: docker.io |
| 15 | + ORG: nephio |
24 | 16 |
|
25 | 17 | permissions: |
26 | 18 | contents: read |
27 | | - packages: write |
28 | 19 |
|
29 | 20 | jobs: |
30 | 21 | build-and-push-image: |
31 | | - if: | |
32 | | - github.repository_owner == 'nephio-project' && ( |
33 | | - github.event_name != 'issue_comment' || |
34 | | - (github.event.issue.pull_request && contains(github.event.comment.body, '/rebuild')) |
35 | | - ) |
| 22 | + if: github.repository_owner == 'nephio-project' |
36 | 23 | runs-on: ubuntu-latest |
37 | | - permissions: |
38 | | - contents: read |
39 | | - packages: write |
40 | 24 | strategy: |
41 | 25 | fail-fast: false |
42 | 26 | matrix: |
43 | 27 | include: |
44 | 28 | - dockerfile: ./build/Dockerfile |
45 | | - image: ${{ github.event_name == 'pull_request' && 'ghcr.io' || 'docker.io' }}/${{ github.event_name == 'pull_request' && github.repository || 'nephio' }}/porch-server |
| 29 | + image: docker.io/nephio/porch-server |
46 | 30 | - dockerfile: ./controllers/Dockerfile |
47 | | - image: ${{ github.event_name == 'pull_request' && 'ghcr.io' || 'docker.io' }}/${{ github.event_name == 'pull_request' && github.repository || 'nephio' }}/porch-controllers |
| 31 | + image: docker.io/nephio/porch-controllers |
48 | 32 | - dockerfile: ./func/Dockerfile |
49 | | - image: ${{ github.event_name == 'pull_request' && 'ghcr.io' || 'docker.io' }}/${{ github.event_name == 'pull_request' && github.repository || 'nephio' }}/porch-function-runner |
| 33 | + image: docker.io/nephio/porch-function-runner |
50 | 34 | - dockerfile: ./func/Dockerfile-wrapperserver |
51 | | - image: ${{ github.event_name == 'pull_request' && 'ghcr.io' || 'docker.io' }}/${{ github.event_name == 'pull_request' && github.repository || 'nephio' }}/porch-wrapper-server |
52 | | - |
| 35 | + image: docker.io/nephio/porch-wrapper-server |
| 36 | + permissions: |
| 37 | + contents: read |
| 38 | + packages: write |
53 | 39 |
|
54 | 40 | steps: |
55 | 41 | - name: Harden Runner |
|
64 | 50 | uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 |
65 | 51 | with: |
66 | 52 | registry: ${{ env.REGISTRY }} |
67 | | - username: ${{ github.event_name == 'pull_request' && github.actor || vars.DOCKERHUB_USERNAME }} |
68 | | - password: ${{ github.event_name == 'pull_request' && secrets.GITHUB_TOKEN || secrets.DOCKERHUB_TOKEN }} |
| 53 | + username: ${{ vars.DOCKERHUB_USERNAME }} |
| 54 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
69 | 55 |
|
70 | 56 | - name: Set up Docker Buildx |
71 | 57 | uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 |
|
85 | 71 | file: ${{ matrix.dockerfile }} |
86 | 72 | push: true |
87 | 73 | tags: | |
88 | | - ${{ matrix.image }}:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || (github.ref_name == 'main' && 'latest' || github.ref_name) }} |
| 74 | + ${{ matrix.image }}:${{ github.ref_name == 'main' && 'latest' || github.ref_name }} |
89 | 75 | labels: ${{ steps.meta.outputs.labels }} |
90 | | - cache-from: type=gha |
91 | | - cache-to: type=gha,mode=max |
92 | | - no-cache: ${{ contains(github.event.comment.body, '/rebuild --no-cache') }} |
| 76 | + no-cache: true |
93 | 77 | sbom: true |
0 commit comments