Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to ghcr #2509

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,36 @@ on:
required: true

env:
REGISTRY_NAME: registry.scality.com
PROJECT_NAME: ${{ github.event.repository.name }}

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_NAME }}
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Push dashboards into the production namespace
run: |
oras push ${{ env.REGISTRY_NAME }}/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}-dashboards:${{ github.event.inputs.tag }} \
ingestion/ingestion-processor-dashboard.json:application/grafana-dashboard+json \
ingestion/ingestion-producer-dashboard.json:application/grafana-dashboard+json \
ingestion/ingestion-global-dashboard.json:application/grafana-dashboard+json \
ingestion/ingestion-processor-alert.yaml:application/prometheus-alerts+yaml \
ingestion/ingestion-producer-alert.yaml:application/prometheus-alerts+yaml
working-directory: monitoring
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.REGISTRY_NAME }}/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}:${{ github.event.inputs.tag }}
tags: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
45 changes: 14 additions & 31 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
uses: actions/checkout@v4
- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

password: ${{ github.token }}
- name: Build and push kafka
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
push: true
context: .github/dockerfiles/kafka
tags: "ghcr.io/scality/backbeat/ci-kafka:${{ github.sha }}"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
tags: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }}
cache-from: type=gha,scope=ci-kafka
cache-to: type=gha,mode=max,scope=ci-kafka

tests:
needs: build
Expand All @@ -60,10 +42,10 @@ jobs:
ports:
- 6379:6379
kafka:
image: ghcr.io/scality/backbeat/ci-kafka:${{ github.sha }}
image: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }}
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ github.token }}
ports:
- 2181:2181
- 9092:9092
Expand All @@ -73,15 +55,16 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- uses: actions/setup-go@v2
- uses: actions/setup-go@v5
with:
go-version: '1.16.2'
- uses: actions/setup-node@v2
cache-dependency-path: ./bucket-scanner/go.sum
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: yarn
Expand Down