Split latest and preview in two files
This commit is contained in:
parent
7c8ce5a470
commit
158229bb51
|
|
@ -1,38 +0,0 @@
|
||||||
name: Build docker image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- develop
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
- 'docker-compose*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
unit_tests:
|
|
||||||
uses: ./.github/workflows/unit_tests.yml
|
|
||||||
|
|
||||||
generate_docker_image:
|
|
||||||
needs: unit_tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build preview image
|
|
||||||
uses: ./.github/workflows/build_image.yml
|
|
||||||
env:
|
|
||||||
TAG_START: 'preview_'
|
|
||||||
UPDATE_DOCKER_HUB_DESCRIPTION: 'false'
|
|
||||||
TAGS: |
|
|
||||||
totonyus/ydl_api_ng:preview
|
|
||||||
|
|
||||||
- name: Build image
|
|
||||||
uses: ./.github/workflows/build_image.yml
|
|
||||||
env:
|
|
||||||
TAG_START: 'latest_'
|
|
||||||
UPDATE_DOCKER_HUB_DESCRIPTION: 'false'
|
|
||||||
TAGS: |
|
|
||||||
totonyus/ydl_api_ng:latest
|
|
||||||
totonyus/ydl_api_ng:preview
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
name: Build docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- 'docker-compose*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
unit_tests:
|
||||||
|
uses: ./.github/workflows/unit_tests.yml
|
||||||
|
|
||||||
|
generate_main_docker_image:
|
||||||
|
needs: unit_tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- id: commit
|
||||||
|
uses: pr-mpt/actions-commit-hash@v1
|
||||||
|
|
||||||
|
- name: Extract branch name
|
||||||
|
shell: bash
|
||||||
|
id: extract_branch
|
||||||
|
run: echo ::set-output name=BRANCH_NAME::${GITHUB_REF#refs/*/}
|
||||||
|
|
||||||
|
- name: Get current time
|
||||||
|
uses: josStorer/get-current-time@v2
|
||||||
|
id: current-time
|
||||||
|
with:
|
||||||
|
format: readableTime
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_LOGIN }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Build docker image (amd)
|
||||||
|
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
|
id: build_amd
|
||||||
|
with:
|
||||||
|
context: ${{ github.workspace }}
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
totonyus/ydl_api_ng:latest_amd
|
||||||
|
totonyus/ydl_api_ng:preview_amd
|
||||||
|
build-args: |
|
||||||
|
GIT_BRANCH=${{ steps.extract_branch.outputs.BRANCH_NAME }}
|
||||||
|
GIT_REVISION=${{ steps.commit.outputs.hash }}
|
||||||
|
DATE=${{ steps.current-time.outputs.time }}
|
||||||
|
|
||||||
|
- name: Build docker image (arm)
|
||||||
|
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
|
id: build_arm
|
||||||
|
with:
|
||||||
|
context: ${{ github.workspace }}
|
||||||
|
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
totonyus/ydl_api_ng:latest_arm
|
||||||
|
totonyus/ydl_api_ng:preview_arm
|
||||||
|
build-args: |
|
||||||
|
GIT_BRANCH=${{ steps.extract_branch.outputs.BRANCH_NAME }}
|
||||||
|
GIT_REVISION=${{ steps.commit.outputs.hash }}
|
||||||
|
DATE=${{ steps.current-time.outputs.time }}
|
||||||
|
|
||||||
|
- uses: int128/docker-manifest-create-action@v2
|
||||||
|
with:
|
||||||
|
tags: |
|
||||||
|
totonyus/ydl_api_ng:latest
|
||||||
|
totonyus/ydl_api_ng:preview
|
||||||
|
sources: |
|
||||||
|
totonyus/ydl_api_ng@${{ steps.build_amd.outputs.digest }}
|
||||||
|
totonyus/ydl_api_ng@${{ steps.build_arm.outputs.digest }}
|
||||||
|
|
@ -1,12 +1,19 @@
|
||||||
name: Build single image
|
name: Build docker image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- '**'
|
- develop
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- 'docker-compose*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate_docker_image:
|
unit_tests:
|
||||||
|
uses: ./.github/workflows/unit_tests.yml
|
||||||
|
|
||||||
|
generate_main_docker_image:
|
||||||
|
needs: unit_tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|
@ -38,29 +45,29 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Build and push Docker image (amd)
|
- name: Build docker image (amd)
|
||||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
id: build_amd
|
id: build_amd
|
||||||
with:
|
with:
|
||||||
context: ${{ github.workspace }}
|
context: ${{ github.workspace }}
|
||||||
file: dockerfile_amd
|
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
tags: totonyus/ydl_api_ng:${{ env.TAG_START }}amd
|
tags: |
|
||||||
|
totonyus/ydl_api_ng:preview_amd
|
||||||
build-args: |
|
build-args: |
|
||||||
GIT_BRANCH=${{ steps.extract_branch.outputs.BRANCH_NAME }}
|
GIT_BRANCH=${{ steps.extract_branch.outputs.BRANCH_NAME }}
|
||||||
GIT_REVISION=${{ steps.commit.outputs.hash }}
|
GIT_REVISION=${{ steps.commit.outputs.hash }}
|
||||||
DATE=${{ steps.current-time.outputs.time }}
|
DATE=${{ steps.current-time.outputs.time }}
|
||||||
|
|
||||||
- name: Build and push Docker image (arm)
|
- name: Build docker image (arm)
|
||||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
id: build_arm
|
id: build_arm
|
||||||
with:
|
with:
|
||||||
context: ${{ github.workspace }}
|
context: ${{ github.workspace }}
|
||||||
file: dockerfile_arm
|
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
|
||||||
platforms: linux/arm/v7,linux/arm64/v8
|
|
||||||
push: true
|
push: true
|
||||||
tags: totonyus/ydl_api_ng:${{ env.TAG_START }}arm
|
tags: |
|
||||||
|
totonyus/ydl_api_ng:preview_arm
|
||||||
build-args: |
|
build-args: |
|
||||||
GIT_BRANCH=${{ steps.extract_branch.outputs.BRANCH_NAME }}
|
GIT_BRANCH=${{ steps.extract_branch.outputs.BRANCH_NAME }}
|
||||||
GIT_REVISION=${{ steps.commit.outputs.hash }}
|
GIT_REVISION=${{ steps.commit.outputs.hash }}
|
||||||
|
|
@ -68,14 +75,14 @@ jobs:
|
||||||
|
|
||||||
- uses: int128/docker-manifest-create-action@v2
|
- uses: int128/docker-manifest-create-action@v2
|
||||||
with:
|
with:
|
||||||
tags: ${{ env.TAGS }}
|
tags: |
|
||||||
|
totonyus/ydl_api_ng:preview
|
||||||
sources: |
|
sources: |
|
||||||
totonyus/ydl_api_ng@${{ steps.build_amd.outputs.digest }}
|
totonyus/ydl_api_ng@${{ steps.build_amd.outputs.digest }}
|
||||||
totonyus/ydl_api_ng@${{ steps.build_arm.outputs.digest }}
|
totonyus/ydl_api_ng@${{ steps.build_arm.outputs.digest }}
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v3.0.0
|
uses: peter-evans/dockerhub-description@v3.0.0
|
||||||
if: ${{ env.UPDATE_DOCKER_HUB_DESCRIPTION == 'true' }}
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_LOGIN }}
|
username: ${{ secrets.DOCKER_HUB_LOGIN }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
Loading…
Reference in New Issue