blob: e8312228da70be269b61ce3a4be5676b93abb53e [file] [log] [blame]
Mohammed Nasera4e52902022-08-30 00:20:05 -04001name: test
2on:
3 pull_request: {}
Mohammed Nasera4e52902022-08-30 00:20:05 -04004
5jobs:
Mohammed Naserbd5eaa12022-08-30 03:03:49 -04006 build-image-strategy:
Mohammed Nasera4e52902022-08-30 00:20:05 -04007 runs-on: ubuntu-latest
8 steps:
9 - uses: actions/checkout@v3.0.2
Mohammed Naserbd5eaa12022-08-30 03:03:49 -040010 - id: set-strategy
Mohammed Naser81d183d2022-08-30 03:14:11 -040011 run: echo "::set-output name=strategy::$(./ci/build-image-strategy build)"
Mohammed Nasera4e52902022-08-30 00:20:05 -040012 outputs:
Mohammed Naserbd5eaa12022-08-30 03:03:49 -040013 strategy: ${{ steps.set-strategy.outputs.strategy }}
Mohammed Nasera4e52902022-08-30 00:20:05 -040014
15 build-openstack-images:
Mohammed Naserbd5eaa12022-08-30 03:03:49 -040016 if: needs.build-image-strategy.outputs.strategy != '{}'
Mohammed Nasera4e52902022-08-30 00:20:05 -040017 runs-on: ubuntu-latest
Mohammed Naser4762fb92022-08-30 00:42:11 -040018 needs:
Mohammed Naserbd5eaa12022-08-30 03:03:49 -040019 - build-image-strategy
20 strategy: ${{ fromJSON(needs.build-image-strategy.outputs.strategy) }}
Mohammed Nasera4e52902022-08-30 00:20:05 -040021 steps:
Mohammed Naser82e50812022-08-30 00:58:10 -040022 - 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 Nasera4e52902022-08-30 00:20:05 -040025 - run: ./ci/openstack-image-build-env ${{ matrix.project }} ${{ matrix.release }} >> $GITHUB_ENV
Mohammed Naser82e50812022-08-30 00:58:10 -040026 - uses: docker/login-action@v2.0.0
Mohammed Nasera4e52902022-08-30 00:20:05 -040027 with:
28 registry: quay.io
29 username: ${{ secrets.QUAY_USERNAME }}
30 password: ${{ secrets.QUAY_ROBOT_TOKEN }}
Mohammed Naser82e50812022-08-30 00:58:10 -040031 - uses: docker/build-push-action@v3.1.1
Mohammed Nasera4e52902022-08-30 00:20:05 -040032 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