|
1 |
| -name: Build and Publish Data Processing and EMP Games Docker Images |
| 1 | +name: Build, Test, and Publish the FBPCS Docker Images |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches: [ main ]
|
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
6 | 8 |
|
7 | 9 | env:
|
8 |
| - FBPCF_VERSION: 2.1.144 # Please also update line 25 (FBPCF_VERSION) in .github/workflows/docker-publish.yml |
| 10 | + FBPCF_VERSION: 2.1.144 # Please also update line 25 in .github/workflows/docker-publish.yml |
| 11 | + PID_VERSION: 0.0.8 # Please also update line 26 in .github/workflows/docker-publish.yml |
9 | 12 | REGISTRY: ghcr.io
|
| 13 | + LOCAL_IMAGE_NAME: fbpcs/onedocker/test |
| 14 | + RC_REGISTRY_URL: ghcr.io/${{ github.repository }}/rc |
| 15 | + RC_REGISTRY_IMAGE_NAME: ghcr.io/${{ github.repository }}/rc/onedocker |
10 | 16 |
|
11 | 17 | jobs:
|
12 | 18 | output_version:
|
|
18 | 24 | - id: set_version
|
19 | 25 | run: echo "version=${{ env.FBPCF_VERSION }}" >> $GITHUB_OUTPUT
|
20 | 26 |
|
| 27 | + build_coordinator_image: |
| 28 | + name: Build the Coordinator image |
| 29 | + uses: ./.github/workflows/coordinator-publish.yml |
| 30 | + with: |
| 31 | + new_tag: ${{ github.sha }} |
| 32 | + push_to_registry: ${{ github.event_name != pull_request || github.event.pull_request.head.repo.full_name == github.repository }} |
| 33 | + |
21 | 34 | build_and_publish_data_processing_image:
|
22 | 35 | name: Build and Publish Data Processing Image
|
23 | 36 | needs: output_version
|
|
26 | 39 | image_to_build: data_processing
|
27 | 40 | tag: latest
|
28 | 41 | fbpcf_version: ${{needs.output_version.outputs.fbpcf_version}}
|
29 |
| - push_to_registry: true |
| 42 | + push_to_registry: ${{ github.event_name != pull_request || github.event.pull_request.head.repo.full_name == github.repository }} |
30 | 43 |
|
31 | 44 | build_and_publish_emp_games_image:
|
32 | 45 | name: Build and Publish EMP Games Image
|
|
36 | 49 | image_to_build: emp_games
|
37 | 50 | tag: latest
|
38 | 51 | fbpcf_version: ${{needs.output_version.outputs.fbpcf_version}}
|
39 |
| - push_to_registry: true |
| 52 | + push_to_registry: ${{ github.event_name != pull_request || github.event.pull_request.head.repo.full_name == github.repository }} |
| 53 | + |
| 54 | + build_test_onedocker_image: |
| 55 | + name: Build the bundled test version of the onedocker image |
| 56 | + needs: [build_and_publish_data_processing_image, build_and_publish_emp_games_image] |
| 57 | + runs-on: ubuntu-latest |
| 58 | + if: github.event_name != pull_request || github.event.pull_request.head.repo.full_name == github.repository |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v3 |
| 61 | + |
| 62 | + - name: Set up Docker Buildx |
| 63 | + uses: docker/setup-buildx-action@v2 |
| 64 | + |
| 65 | + - name: Log into registry ${{ env.REGISTRY }} |
| 66 | + uses: docker/login-action@v2 |
| 67 | + with: |
| 68 | + registry: ${{ env.REGISTRY }} |
| 69 | + username: ${{ github.actor }} |
| 70 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + |
| 72 | + - name: Build Image |
| 73 | + uses: docker/build-push-action@v3 |
| 74 | + with: |
| 75 | + context: . |
| 76 | + file: docker/onedocker/test/Dockerfile.ubuntu |
| 77 | + tags: | |
| 78 | + ${{ env.RC_REGISTRY_IMAGE_NAME }}:${{ github.sha }} |
| 79 | + build-args: | |
| 80 | + tag=${{ github.sha }} |
| 81 | + os_release=20.04 |
| 82 | + private_id_tag=${{ env.PID_VERSION }} |
| 83 | + repository_url=${{ env.RC_REGISTRY_URL }} |
| 84 | + push: true |
| 85 | + pull: true |
| 86 | + cache-from: type=gha,scope=onedocker-test-${{ github.ref_name }} |
| 87 | + cache-to: type=gha,scope=onedocker-test-${{ github.ref_name }},mode=max |
0 commit comments