@@ -19,39 +19,16 @@ jobs:
1919 build-operations-metrics-container :
2020 if : github.repository_owner == 'llvm'
2121 runs-on : ubuntu-24.04
22- outputs :
23- container-name : ${{ steps.vars.outputs.container-name }}
24- container-name-tag : ${{ steps.vars.outputs.container-name-tag }}
25- container-filename : ${{ steps.vars.outputs.container-filename }}
2622 steps :
2723 - name : Checkout LLVM Zorg
2824 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2925 with :
3026 sparse-checkout : premerge/ops-container
31- - name : Write Variables
32- id : vars
33- run : |
34- tag=`date +%s`
35- container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/operations-metrics"
36- echo "container-name=$container_name" >> $GITHUB_OUTPUT
37- echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT
38- echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
3927 - name : Build Container
40- working-directory : premerge/ops-container
41- run : |
42- podman build -t ${{ steps.vars.outputs.container-name-tag }} .
43- # Save the container so we have it in case the push fails. This also
44- # allows us to separate the push step into a different job so we can
45- # maintain minimal permissions while building the container.
46- - name : Save Container Image
47- run : |
48- podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
49- - name : Upload Container Image
50- uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
28+ uses : llvm/llvm-project/.github/actions/build-container@883aa1207e0319362f9b9907158520d28f45fb72
5129 with :
52- name : container
53- path : ${{ steps.vars.outputs.container-filename }}
54- retention-days : 14
30+ container-name : operations-metrics
31+ context : premerge/ops-container
5532
5633 push-operations-metrics-container :
5734 if : github.event_name == 'push'
6340 env :
6441 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6542 steps :
66- - name : Download Container Image
67- uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
43+ - uses : llvm/llvm-project/.github/actions/push-container@883aa1207e0319362f9b9907158520d28f45fb72
6844 with :
69- name : container
70- - name : Push Container
71- run : |
72- podman load -i ${{ needs.build-operations-metrics-container.outputs.container-filename }}
73- podman tag ${{ needs.build-operations-metrics-container.outputs.container-name-tag }} ${{ needs.build-operations-metrics-container.outputs.container-name }}:latest
74- podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io
75- podman push ${{ needs.build-operations-metrics-container.outputs.container-name-tag }}
76- podman push ${{ needs.build-operations-metrics-container.outputs.container-name }}:latest
45+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments