|
62 | 62 | labels: ${{ steps.docker-metadata.outputs.labels }} |
63 | 63 | cache-from: type=gha |
64 | 64 | cache-to: type=gha,mode=max |
65 | | - |
66 | | - build-macos-image: |
67 | | - name: Build Docker image for macOS |
68 | | - runs-on: macos-latest |
69 | | - permissions: |
70 | | - contents: read |
71 | | - packages: write |
72 | | - env: |
73 | | - BASE_REPO: "ghcr.io/stacklok" |
74 | | - CODEGATE_SERVER_IMAGE: "ghcr.io/stacklok/codegate-macos" |
75 | | - steps: |
76 | | - - name: Checkout |
77 | | - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 |
78 | | - - name: Set up Docker Buildx |
79 | | - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3 |
80 | | - - name: Compute version number |
81 | | - id: version-string |
82 | | - run: | |
83 | | - DATE="$(date +%Y%m%d)" |
84 | | - COMMIT="$(git rev-parse --short HEAD)" |
85 | | - echo "tag=0.$DATE.$GITHUB_RUN_NUMBER+ref.$COMMIT" >> "$GITHUB_OUTPUT" |
86 | | - - name: Login to GHCR |
87 | | - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 |
88 | | - with: |
89 | | - registry: ghcr.io |
90 | | - username: ${{ github.actor }} |
91 | | - password: ${{ secrets.GITHUB_TOKEN }} |
92 | | - - name: Set container metadata |
93 | | - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5 |
94 | | - id: docker-metadata |
95 | | - with: |
96 | | - images: ${{ env.CODEGATE_SERVER_IMAGE }} |
97 | | - labels: | |
98 | | - org.opencontainers.image.source=${{ github.repositoryUrl }} |
99 | | - org.opencontainers.image.description="This is a container for the Stacklok Codegate server" |
100 | | - org.opencontainers.image.title="Stacklok Codegate Server" |
101 | | - org.opencontainers.image.vendor="Stacklok Inc." |
102 | | - org.opencontainers.image.version=${{ github.sha }} |
103 | | - flavor: | |
104 | | - latest=true |
105 | | - tags: | |
106 | | - type=raw,value=${{ steps.version-string.outputs.tag }} |
107 | | - - name: Build image for macOS |
108 | | - id: image-build-macos |
109 | | - uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v5 |
110 | | - with: |
111 | | - context: . |
112 | | - platforms: darwin/amd64 |
113 | | - push: true |
114 | | - file: ./Dockerfile |
115 | | - tags: ${{ steps.docker-metadata.outputs.tags }} |
116 | | - labels: ${{ steps.docker-metadata.outputs.labels }} |
117 | | - cache-from: type=gha |
118 | | - cache-to: type=gha,mode=max |
0 commit comments