This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
forked from ceph/ceph
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from aquarist-labs/wip-s3gw-build-action
- Loading branch information
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
name: Build and Push S3GW Image | ||
on: | ||
|
||
pull_request: | ||
branches: | ||
- "s3gw" | ||
types: [ labeled ] | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
# Note: max 128 chars according to OCI Distribution Spec | ||
IMAGE_TAG: pr-${{ github.workflow_sha }}-${{ github.run_id }}-${{ github.run_attempt }} | ||
|
||
jobs: | ||
tests: | ||
if: github.event.label.name == 'ci/build-s3gw-image' || github.event_name == 'workflow_dispatch' | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout s3gw | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: aquarist-labs/s3gw | ||
path: s3gw | ||
submodules: false | ||
|
||
- name: Checkout ceph | ||
uses: actions/checkout@v3 | ||
with: | ||
path: s3gw/ceph | ||
submodules: recursive | ||
|
||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Context | ||
run: | | ||
docker context create builder | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
endpoint: builder | ||
|
||
- name: quay.io Login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Build Container Image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
build-args: | | ||
CMAKE_BUILD_TYPE=Release | ||
S3GW_VERSION=${{ env.IMAGE_TAG }} | ||
NPROC=16 | ||
QUAY_EXPIRATION=1w | ||
tags: | | ||
quay.io/s3gw/s3gw:${{ env.IMAGE_TAG }} | ||
file: s3gw/Dockerfile | ||
context: s3gw | ||
|
||
- name: Add comment to image URL and image:tag | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: '📦 quay.io/s3gw/s3gw:${{ env.IMAGE_TAG }} https://quay.io/repository/s3gw/s3gw?tab=tags&tag=${{ env.IMAGE_TAG }}' | ||
}) |