Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 1 | name: test |
| 2 | on: |
| 3 | pull_request: {} |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 4 | |
| 5 | jobs: |
Mohammed Naser | bd5eaa1 | 2022-08-30 03:03:49 -0400 | [diff] [blame] | 6 | build-image-strategy: |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 7 | runs-on: ubuntu-latest |
| 8 | steps: |
| 9 | - uses: actions/checkout@v3.0.2 |
Mohammed Naser | bd5eaa1 | 2022-08-30 03:03:49 -0400 | [diff] [blame] | 10 | - id: set-strategy |
Mohammed Naser | 81d183d | 2022-08-30 03:14:11 -0400 | [diff] [blame^] | 11 | run: echo "::set-output name=strategy::$(./ci/build-image-strategy build)" |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 12 | outputs: |
Mohammed Naser | bd5eaa1 | 2022-08-30 03:03:49 -0400 | [diff] [blame] | 13 | strategy: ${{ steps.set-strategy.outputs.strategy }} |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 14 | |
| 15 | build-openstack-images: |
Mohammed Naser | bd5eaa1 | 2022-08-30 03:03:49 -0400 | [diff] [blame] | 16 | if: needs.build-image-strategy.outputs.strategy != '{}' |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 17 | runs-on: ubuntu-latest |
Mohammed Naser | 4762fb9 | 2022-08-30 00:42:11 -0400 | [diff] [blame] | 18 | needs: |
Mohammed Naser | bd5eaa1 | 2022-08-30 03:03:49 -0400 | [diff] [blame] | 19 | - build-image-strategy |
| 20 | strategy: ${{ fromJSON(needs.build-image-strategy.outputs.strategy) }} |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 21 | steps: |
Mohammed Naser | 82e5081 | 2022-08-30 00:58:10 -0400 | [diff] [blame] | 22 | - uses: actions/checkout@v3.0.2 |
| 23 | - uses: docker/setup-qemu-action@v2.0.0 |
| 24 | - uses: docker/setup-buildx-action@v2.0.0 |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 25 | - run: ./ci/openstack-image-build-env ${{ matrix.project }} ${{ matrix.release }} >> $GITHUB_ENV |
Mohammed Naser | 82e5081 | 2022-08-30 00:58:10 -0400 | [diff] [blame] | 26 | - uses: docker/login-action@v2.0.0 |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 27 | with: |
| 28 | registry: quay.io |
| 29 | username: ${{ secrets.QUAY_USERNAME }} |
| 30 | password: ${{ secrets.QUAY_ROBOT_TOKEN }} |
Mohammed Naser | 82e5081 | 2022-08-30 00:58:10 -0400 | [diff] [blame] | 31 | - uses: docker/build-push-action@v3.1.1 |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 32 | with: |
| 33 | context: images/openstack |
| 34 | cache-from: type=gha,scope=${{ matrix.project }}-${{ matrix.release }} |
| 35 | cache-to: type=gha,mode=max,scope=${{ matrix.project }}-${{ matrix.release }} |
| 36 | platforms: ${{ env.PLATFORMS }} |
| 37 | push: true |
| 38 | build-args: | |
| 39 | RELEASE=${{ matrix.release }} |
| 40 | PROJECT=${{ matrix.project }} |
| 41 | PROJECT_REF=${{ env.PROJECT_REF }} |
| 42 | PROFILES=${{ env.PROFILES }} |
| 43 | DIST_PACKAGES=${{ env.DIST_PACKAGES }} |
| 44 | PIP_PACKAGES=${{ env.PIP_PACKAGES }} |
| 45 | tags: | |
| 46 | quay.io/vexxhost/${{ matrix.project }}:${{ env.PROJECT_REF }} |
| 47 | |
| 48 | # TODO(mnaser): Molecule |