-
-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
140 additions
and
25 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 |
---|---|---|
|
@@ -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: | ||
|
@@ -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 # | ||
|
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 |
---|---|---|
|
@@ -195,7 +195,6 @@ jobs: | |
id: meta | ||
with: | ||
images: | | ||
${{ github.repository }}-only-${{ matrix.linter }} | ||
ghcr.io/${{ github.repository }}-only-${{ matrix.linter }} | ||
flavor: | | ||
latest=false | ||
|
@@ -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: | ||
|
@@ -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 # | ||
############################################## | ||
|
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 |
---|---|---|
|
@@ -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: | ||
|
@@ -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 # | ||
# ############################### | ||
|