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