Create .dockerignore #12
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
name: Release | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-20.04 | |
outputs: | |
published: ${{ steps.semantic.outputs.new_release_published }} | |
version: ${{ steps.semantic.outputs.new_release_version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v3.4.1 | |
with: | |
semantic_version: 18 | |
extra_plugins: | | |
@semantic-release/release-notes-generator@^10 | |
@semantic-release/github@^8 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish_x86: | |
needs: | |
- release | |
if: needs.release.outputs.published == 'true' | |
runs-on: ubuntu-latest | |
env: | |
arch: amd64 | |
outputs: | |
image_digest: ${{ steps.build.outputs.digest }} | |
steps: | |
- id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
khulnasoft/edge-runtime | |
tags: | | |
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} | |
- uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- id: build | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
platforms: linux/${{ env.arch }} | |
tags: ${{ steps.meta.outputs.tags }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
GIT_V_VERSION=${{ needs.release.outputs.version }} | |
publish_arm: | |
needs: | |
- release | |
if: needs.release.outputs.published == 'true' | |
runs-on: arm-runner | |
env: | |
arch: arm64 | |
outputs: | |
image_digest: ${{ steps.build.outputs.digest }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
khulnasoft/edge-runtime | |
tags: | | |
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker | |
driver-opts: | | |
image=moby/buildkit:master | |
network=host | |
- id: build | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/${{ env.arch }} | |
tags: ${{ steps.meta.outputs.tags }} | |
no-cache: true | |
build-args: | | |
GIT_V_VERSION=${{ needs.release.outputs.version }} | |
merge_manifest: | |
needs: [release, publish_x86, publish_arm] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Merge multi-arch manifests | |
run: | | |
docker buildx imagetools create -t khulnasoft/edge-runtime:v${{ needs.release.outputs.version }} \ | |
khulnasoft/edge-runtime@${{ needs.publish_x86.outputs.image_digest }} \ | |
khulnasoft/edge-runtime@${{ needs.publish_arm.outputs.image_digest }} | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ secrets.PROD_AWS_ROLE }} | |
aws-region: us-east-1 | |
- name: Login to ECR | |
uses: docker/login-action@v2 | |
with: | |
registry: public.ecr.aws | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Mirror to ECR | |
uses: akhilerm/tag-push-action@v2.0.0 | |
with: | |
src: docker.io/khulnasoft/edge-runtime:v${{ needs.release.outputs.version }} | |
dst: | | |
public.ecr.aws/khulnasoft/edge-runtime:v${{ needs.release.outputs.version }} | |
ghcr.io/khulnasoft/edge-runtime:v${{ needs.release.outputs.version }} |