Skip to content

Commit

Permalink
Update Beta generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Oct 12, 2024
1 parent fad9506 commit 0c99a55
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 25 deletions.
65 changes: 56 additions & 9 deletions .github/workflows/deploy-BETA-flavors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,39 +94,56 @@ jobs:
id: meta
with:
images: |
${{ github.repository }}-${{ matrix.flavor }}
ghcr.io/${{ github.repository }}-${{ matrix.flavor }}
flavor: |
latest=false
prefix=beta
tags: |
type=raw,value=
- name: Docker Metadata action (Docker Hub)
uses: docker/[email protected]
id: meta-dhub
with:
images: |
${{ github.repository }}-${{ matrix.flavor }}
flavor: |
latest=false
prefix=beta
tags: |
type=raw,value=
- name: Docker Metadata action (Worker)
uses: docker/[email protected]
id: meta-w
with:
images: |
name=${{ github.repository }}-worker-${{ matrix.flavor }},enable=false
name=ghcr.io/${{ github.repository }}-worker-${{ matrix.flavor }}
flavor: |
latest=false
prefix=beta
tags: |
type=raw,value=
- name: Docker Metadata action (Worker Docker Hub)
uses: docker/[email protected]
id: meta-w-dhub
with:
images: |
name=${{ github.repository }}-worker-${{ matrix.flavor }},enable=false
flavor: |
latest=false
prefix=beta
tags: |
type=raw,value=
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ ( ( runner.arch != 'X64' || runner.os != 'Linux' ) && matrix.platform == 'linux/amd64' ) || matrix.platform != 'linux/amd64' }}

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -172,7 +189,37 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
secrets: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta-w.outputs.tags }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Copy ghrc.io image to Docker Hub (main image)
- name: Pull image from GHCR
run: docker pull ${{ steps.meta.outputs.tags[0] }}
- name: Tag image for Docker Hub
run: docker tag ${{ steps.meta.outputs.tags[0] }} ${{ steps.meta-dhub.outputs.tags[0] }}
- name: Push image to Docker Hub
run: docker push ${{ steps.meta-dhub.outputs.tags[0] }}

# Copy ghrc.io image to Docker Hub (server)
- name: Pull image from GHCR
run: docker pull ${{ steps.meta-s.outputs.tags[0] }}
- name: Tag image for Docker Hub
run: docker tag ${{ steps.meta-s.outputs.tags[0] }} ${{ steps.meta-s-dhub.outputs.tags[0] }}
- name: Push image to Docker Hub
run: docker push ${{ steps.meta-s-dhub.outputs.tags[0] }}

# Copy ghrc.io image to Docker Hub (worker)
- name: Pull image from GHCR
run: docker pull ${{ steps.meta-w.outputs.tags[0] }}
- name: Tag image for Docker Hub
run: docker tag ${{ steps.meta-w.outputs.tags[0] }} ${{ steps.meta-w-dhub.outputs.tags[0] }}
- name: Push image to Docker Hub
run: docker push ${{ steps.meta-w-dhub.outputs.tags[0] }}

##############################################
# Check Docker image security with Trivy #
Expand Down
34 changes: 27 additions & 7 deletions .github/workflows/deploy-BETA-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ jobs:
id: meta
with:
images: |
${{ github.repository }}-only-${{ matrix.linter }}
ghcr.io/${{ github.repository }}-only-${{ matrix.linter }}
flavor: |
latest=false
Expand All @@ -204,19 +203,26 @@ jobs:
type=raw,value=
type=raw,value={{date 'YYYYMMDD_HHmm'}}
- name: Docker Metadata action (Docker hub)
uses: docker/[email protected]
id: meta-dhub
with:
images: |
${{ github.repository }}-only-${{ matrix.linter }}
flavor: |
latest=false
prefix=beta
tags: |
type=raw,value=
type=raw,value={{date 'YYYYMMDD_HHmm'}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ ( ( runner.arch != 'X64' || runner.os != 'Linux' ) && matrix.platform == 'linux/amd64' ) || matrix.platform != 'linux/amd64' }}

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -255,6 +261,20 @@ jobs:
docker run -e TEST_CASE_RUN=true -e OUTPUT_FORMAT=text -e OUTPUT_FOLDER=${{ github.sha }} -e OUTPUT_DETAIL=detailed -e GITHUB_SHA=${{ github.sha }} -e GITHUB_REPOSITORY=${GITHUB_REPOSITORY} -e GITHUB_BRANCH=${GITHUB_BRANCH} -e GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" -e TEST_KEYWORDS="${TEST_KEYWORDS_TO_USE}" -e MEGALINTER_VOLUME_ROOT="${GITHUB_WORKSPACE}" -v "/var/run/docker.sock:/var/run/docker.sock:rw" -v ${GITHUB_WORKSPACE}:/tmp/lint ${{ fromJson(steps.meta.outputs.json).tags[0]}}
timeout-minutes: 30

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Copy ghrc.io image to Docker Hub (main image)
- name: Pull image from GHCR
run: docker pull ${{ steps.meta.outputs.tags[0] }}
- name: Tag image for Docker Hub
run: docker tag ${{ steps.meta.outputs.tags[0] }} ${{ steps.meta-dhub.outputs.tags[0] }}
- name: Push image to Docker Hub
run: docker push ${{ steps.meta-dhub.outputs.tags[0] }}

##############################################
# Check Docker image security with Trivy #
##############################################
Expand Down
66 changes: 57 additions & 9 deletions .github/workflows/deploy-BETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,43 +83,61 @@ jobs:
id: meta
with:
images: |
name=${{ github.repository }}
name=ghcr.io/${{ github.repository }}
tags: |
type=raw,value=beta
- name: Docker Metadata action (Docker Hub)
uses: docker/[email protected]
id: meta-dhub
with:
images: |
name=${{ github.repository }}
tags: |
type=raw,value=beta
- name: Docker Metadata action (Server)
uses: docker/[email protected]
id: meta-s
with:
images: |
name=${{ github.repository }}-server,enable=false
name=ghcr.io/${{ github.repository }}-server
tags: |
type=raw,value=beta
- name: Docker Metadata action (Server Docker Hub)
uses: docker/[email protected]
id: meta-s-dhub
with:
images: |
name=${{ github.repository }}-server,enable=false
tags: |
type=raw,value=beta
- name: Docker Metadata action (Worker)
uses: docker/[email protected]
id: meta-w
with:
images: |
name=${{ github.repository }}-worker,enable=false
name=ghcr.io/${{ github.repository }}-worker
tags: |
type=raw,value=beta
- name: Docker Metadata action (Worker Server)
uses: docker/[email protected]
id: meta-w-dhub
with:
images: |
name=${{ github.repository }}-worker,enable=false
tags: |
type=raw,value=beta
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -176,6 +194,36 @@ jobs:
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
tags: ${{ steps.meta-w.outputs.tags }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Copy ghrc.io image to Docker Hub (main image)
- name: Pull image from GHCR
run: docker pull ${{ steps.meta.outputs.tags[0] }}
- name: Tag image for Docker Hub
run: docker tag ${{ steps.meta.outputs.tags[0] }} ${{ steps.meta-dhub.outputs.tags[0] }}
- name: Push image to Docker Hub
run: docker push ${{ steps.meta-dhub.outputs.tags[0] }}

# Copy ghrc.io image to Docker Hub (server)
- name: Pull image from GHCR
run: docker pull ${{ steps.meta-s.outputs.tags[0] }}
- name: Tag image for Docker Hub
run: docker tag ${{ steps.meta-s.outputs.tags[0] }} ${{ steps.meta-s-dhub.outputs.tags[0] }}
- name: Push image to Docker Hub
run: docker push ${{ steps.meta-s-dhub.outputs.tags[0] }}

# Copy ghrc.io image to Docker Hub (worker)
- name: Pull image from GHCR
run: docker pull ${{ steps.meta-w.outputs.tags[0] }}
- name: Tag image for Docker Hub
run: docker tag ${{ steps.meta-w.outputs.tags[0] }} ${{ steps.meta-w-dhub.outputs.tags[0] }}
- name: Push image to Docker Hub
run: docker push ${{ steps.meta-w-dhub.outputs.tags[0] }}

# ###############################
# # Run tests for code coverage #
# ###############################
Expand Down

0 comments on commit 0c99a55

Please sign in to comment.