|
11 | 11 |
|
12 | 12 | jobs:
|
13 | 13 | build:
|
14 |
| - name: stagex build+push |
| 14 | + name: build artifacts |
15 | 15 | # We use a special group that is configured to use github largest runner instance
|
16 | 16 | # This is charged by the minute, so if you want to reduce cost change back to `runs-on: ubuntu-latest`
|
17 | 17 | runs-on:
|
18 | 18 | group: ubuntu-runners
|
19 |
| - strategy: |
20 |
| - fail-fast: false |
21 |
| - matrix: |
22 |
| - include: |
23 |
| - - target: qos_client |
24 |
| - - target: qos_host |
25 |
| - - target: qos_enclave |
26 |
| - permissions: |
27 |
| - id-token: write |
28 |
| - contents: read |
29 |
| - packages: write |
30 | 19 | steps:
|
31 | 20 | - name: Checkout sources
|
32 | 21 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
33 |
| - |
34 | 22 | - name: Setup Docker
|
35 | 23 | uses: ./.github/actions/docker-setup
|
36 |
| - |
37 |
| - - name: Run `make ${{ matrix.target }}` |
38 |
| - shell: 'script -q -e -c "bash {0}"' |
39 |
| - run: | |
40 |
| - echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin |
41 |
| - make -j$(nproc) out/${{ matrix.target }}/index.json |
42 |
| -
|
43 |
| - - name: upload to GHCR |
44 |
| - run: | |
45 |
| - echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin |
46 |
| -
|
47 |
| - env -C out/${{ matrix.target }} tar -cf - . | docker load |
48 |
| -
|
49 |
| - for tag in ${tags}; do |
50 |
| - docker tag "qos-local/${{ matrix.target }}:latest" "ghcr.io/tkhq/${{ matrix.target }}:${tag}" |
51 |
| - done |
52 |
| -
|
53 |
| - docker image push --all-tags ghcr.io/tkhq/${{ matrix.target }} |
54 |
| -
|
55 |
| - - name: Configure AWS Credentials |
56 |
| - uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 |
57 |
| - with: |
58 |
| - aws-region: us-east-1 |
59 |
| - role-to-assume: arn:aws:iam::799078726966:role/github-mono |
60 |
| - |
61 |
| - - name: Configure AWS Credentials |
62 |
| - uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 |
63 |
| - with: |
64 |
| - aws-region: us-east-1 |
65 |
| - role-to-assume: arn:aws:iam::799078726966:role/github-qos |
66 |
| - |
67 |
| - - name: Login to Amazon ECR |
68 |
| - id: login-ecr |
69 |
| - uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 |
70 |
| - |
71 |
| - - name: Upload to ECR |
| 24 | + - name: Run `make` |
72 | 25 | shell: 'script -q -e -c "bash {0}"'
|
73 | 26 | run: |
|
74 |
| - echo "${{ steps.login-ecr.outputs.docker_password_799078726966_dkr_ecr_us_east_1_amazonaws_com }}" | \ |
75 |
| - docker login \ |
76 |
| - ${{ steps.login-ecr.outputs.registry }} \ |
77 |
| - -u "${{ steps.login-ecr.outputs.docker_username_799078726966_dkr_ecr_us_east_1_amazonaws_com }}" \ |
78 |
| - --password-stdin |
79 |
| -
|
80 |
| - export BASE_IMAGE_NAME="${{ steps.login-ecr.outputs.registry }}/tkhq/${{ matrix.target }}" |
81 |
| - export IMAGE_NAME="${BASE_IMAGE_NAME}:sha-${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" |
82 |
| - export DIGEST_FILE=/tmp/image-digest-${{ matrix.target }}.sha256 |
83 |
| -
|
84 |
| - cat out/${{ matrix.target }}/index.json | jq -r .manifests[].digest > "${DIGEST_FILE}" |
85 |
| -
|
86 |
| - docker tag "qos-local/${{ matrix.target }}:latest" "$IMAGE_NAME" |
87 |
| -
|
88 |
| - for tag in ${tags}; do |
89 |
| - docker tag "$IMAGE_NAME" "$BASE_IMAGE_NAME:${tag}" |
90 |
| - done |
91 |
| -
|
92 |
| - docker image push --all-tags "$BASE_IMAGE_NAME" |
93 |
| -
|
94 |
| - echo "Uploaded image $IMAGE_NAME (SHA-256 digest: $(cat $DIGEST_FILE))" |
95 |
| -
|
| 27 | + make -j$(nproc) |
0 commit comments