From 9010abdcf82f2e505bfaa2d4874cdad4db1ee926 Mon Sep 17 00:00:00 2001 From: dholms Date: Thu, 4 Jan 2024 14:59:05 -0600 Subject: [PATCH] build ozone images --- .../workflows/build-and-push-ozone-aws.yaml | 55 ++++++++++++++++++ .../workflows/build-and-push-ozone-ghcr.yaml | 56 +++++++++++++++++++ services/ozone/api.js | 2 +- 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-and-push-ozone-aws.yaml create mode 100644 .github/workflows/build-and-push-ozone-ghcr.yaml diff --git a/.github/workflows/build-and-push-ozone-aws.yaml b/.github/workflows/build-and-push-ozone-aws.yaml new file mode 100644 index 00000000000..300b66759cb --- /dev/null +++ b/.github/workflows/build-and-push-ozone-aws.yaml @@ -0,0 +1,55 @@ +name: build-and-push-ozone-aws +on: + push: + branches: + - main + - appeal-report +env: + REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }} + USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }} + PASSWORD: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_PASSWORD }} + IMAGE_NAME: ozone + +jobs: + ozone-container-aws: + if: github.repository == 'bluesky-social/atproto' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.USERNAME}} + password: ${{ env.PASSWORD }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha,enable=true,priority=100,prefix=,suffix=,format=long + + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + file: ./services/ozone/Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/build-and-push-ozone-ghcr.yaml b/.github/workflows/build-and-push-ozone-ghcr.yaml new file mode 100644 index 00000000000..ab37093963d --- /dev/null +++ b/.github/workflows/build-and-push-ozone-ghcr.yaml @@ -0,0 +1,56 @@ +name: build-and-push-ozone-ghcr +on: + push: + branches: + - main +env: + REGISTRY: ghcr.io + USERNAME: ${{ github.actor }} + PASSWORD: ${{ secrets.GITHUB_TOKEN }} + + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + +jobs: + ozone-container-ghcr: + if: github.repository == 'bluesky-social/atproto' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.USERNAME }} + password: ${{ env.PASSWORD }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha,enable=true,priority=100,prefix=ozone:,suffix=,format=long + + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + file: ./services/ozone/Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/services/ozone/api.js b/services/ozone/api.js index b4c2daeb5f4..02dc656af24 100644 --- a/services/ozone/api.js +++ b/services/ozone/api.js @@ -56,4 +56,4 @@ const maintainXrpcResource = (span, req) => { } } -main() \ No newline at end of file +main()