Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #203 from aquarist-labs/wip-s3gw-build-action
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Lauhoff authored Sep 7, 2023
2 parents c007332 + 2f44009 commit bdc4a18
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build-image-on-pr-label.yaml
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 }}'
})

0 comments on commit bdc4a18

Please sign in to comment.