|
1 | 1 | name: Build |
2 | | -on: [ push, pull_request, release, workflow_dispatch ] |
| 2 | +on: [ push, pull_request, workflow_dispatch ] |
3 | 3 | env: |
4 | 4 | REGISTRY: ghcr.io |
| 5 | + |
5 | 6 | jobs: |
| 7 | + # TODO: DRY w/release.yml |
6 | 8 | setup: |
7 | 9 | runs-on: ubuntu-latest |
8 | 10 |
|
|
62 | 64 | runs-on: ubuntu-latest |
63 | 65 |
|
64 | 66 | container: |
65 | | - image: ${{ needs.build.outputs.build_image }} |
| 67 | + image: ${{ needs.build.outputs.build_image }} |
66 | 68 |
|
67 | 69 | defaults: |
68 | 70 | run: |
|
91 | 93 | name: artifacts |
92 | 94 | path: /opt/app/artifacts/** |
93 | 95 |
|
94 | | - # TODO: DRY push and push-release |
| 96 | + # TODO: DRY w/release.yml |
95 | 97 | push: |
96 | 98 | if: github.event_name != 'release' |
97 | 99 |
|
@@ -126,41 +128,3 @@ jobs: |
126 | 128 | dst: | |
127 | 129 | ${{ steps.meta.outputs.tags }} |
128 | 130 |
|
129 | | - # TODO: DRY push and push-release |
130 | | - push-release: |
131 | | - if: github.event_name == 'release' && github.event.action == 'published' |
132 | | - |
133 | | - needs: [setup] |
134 | | - env: |
135 | | - BASE_IMAGE_NAME: ${{ needs.setup.outputs.base_image_name }} |
136 | | - BUILD_IMAGE: ${{ needs.setup.outputs.build_image }} |
137 | | - |
138 | | - runs-on: ubuntu-latest |
139 | | - |
140 | | - permissions: |
141 | | - packages: write |
142 | | - |
143 | | - steps: |
144 | | - - name: Extract metadata (tags, labels) for Docker |
145 | | - id: meta |
146 | | - uses: docker/metadata-action@v3 |
147 | | - with: |
148 | | - images: ${{ env.BASE_IMAGE_NAME }} |
149 | | - tags: |
150 | | - type=semver,pattern={{major}} |
151 | | - type=semver,pattern={{major}}.{{minor}} |
152 | | - type=semver,pattern={{version}} |
153 | | - |
154 | | - - name: Log in to the Container registry |
155 | | - uses: docker/login-action@v2 |
156 | | - with: |
157 | | - registry: ${{ env.REGISTRY }} |
158 | | - username: ${{ github.actor }} |
159 | | - password: ${{ secrets.GITHUB_TOKEN }} |
160 | | - |
161 | | - - name: Tag and push image |
162 | | - uses: akhilerm/tag-push-action@v2.0.0 |
163 | | - with: |
164 | | - src: ${{ env.BUILD_IMAGE }} |
165 | | - dst: | |
166 | | - ${{ steps.meta.outputs.tags }} |
0 commit comments