| name: test |
| on: |
| pull_request: {} |
| push: |
| branches: |
| - main |
| |
| jobs: |
| build-matrix: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3.0.2 |
| - id: set-matrix |
| run: echo "::set-output name=matrix::$(./ci/build-matrix)" |
| outputs: |
| matrix: ${{ steps.set-matrix.outputs.matrix }} |
| |
| build-openstack-images: |
| runs-on: ubuntu-latest |
| needs: |
| - build-matrix |
| strategy: |
| fail-fast: false |
| matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }} |
| steps: |
| - uses: actions/checkout@v3.0.2 |
| - uses: docker/setup-qemu-action@v2.0.0 |
| - uses: docker/setup-buildx-action@v2.0.0 |
| - run: ./ci/openstack-image-build-env ${{ matrix.project }} ${{ matrix.release }} >> $GITHUB_ENV |
| - uses: docker/login-action@v2.0.0 |
| with: |
| registry: quay.io |
| username: ${{ secrets.QUAY_USERNAME }} |
| password: ${{ secrets.QUAY_ROBOT_TOKEN }} |
| - uses: docker/build-push-action@v3.1.1 |
| with: |
| context: images/openstack |
| cache-from: type=gha,scope=${{ matrix.project }}-${{ matrix.release }} |
| cache-to: type=gha,mode=max,scope=${{ matrix.project }}-${{ matrix.release }} |
| platforms: ${{ env.PLATFORMS }} |
| push: true |
| build-args: | |
| RELEASE=${{ matrix.release }} |
| PROJECT=${{ matrix.project }} |
| PROJECT_REF=${{ env.PROJECT_REF }} |
| PROFILES=${{ env.PROFILES }} |
| DIST_PACKAGES=${{ env.DIST_PACKAGES }} |
| PIP_PACKAGES=${{ env.PIP_PACKAGES }} |
| tags: | |
| quay.io/vexxhost/${{ matrix.project }}:${{ env.PROJECT_REF }} |
| |
| # TODO(mnaser): Molecule |
| |
| promote-openstack-images: |
| if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} |
| runs-on: ubuntu-latest |
| needs: |
| - build-matrix |
| - build-openstack-images |
| strategy: |
| fail-fast: false |
| matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }} |
| steps: |
| - run: ./ci/openstack-image-build-env ${{ matrix.project }} ${{ matrix.release }} >> $GITHUB_ENV |
| - uses: docker/login-action@v2.0.0 |
| with: |
| registry: quay.io |
| username: ${{ secrets.QUAY_USERNAME }} |
| password: ${{ secrets.QUAY_ROBOT_TOKEN }} |
| - uses: akhilerm/tag-push-action@v2.0.0 |
| with: |
| src: quay.io/vexxhost/${{ matrix.project }}:${{ env.PROJECT_REF }} |
| dst: quay.io/vexxhost/${{ matrix.project }}:${{ matrix.release }} |