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

Images support multi arch #488

Merged
merged 17 commits into from
Oct 19, 2022
Prev Previous commit
Next Next commit
finish
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
  • Loading branch information
JaredTan95 committed Oct 19, 2022
commit 0483442d91d29e53232cf0dfa6ffd1aa43725924
41 changes: 17 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: "Release"

on:
# for debug, pls remove this
# release:
# types: [published]
# for debug, remember remove this
pull_request:
branches: [ main ]

Expand All @@ -13,8 +15,9 @@ jobs:
packages: write

env:
# for debug, remember remove this
#RELEASE_VERSION: "${{ github.event.release.tag_name }}"
RELEASE_VERSION: "test"
RELEASE_VERSION: "dev"
DOCKERHUB_REPO: "otel/demo"
GHCR_REPO: "ghcr.io/open-telemetry/demo"

Expand All @@ -41,17 +44,6 @@ jobs:
with:
fetch-depth: 0

# - name: Update .env
# run: sed -i "s/IMAGE_VERSION=.*/IMAGE_VERSION=${RELEASE_VERSION}/" .env

# - name: Commit updated .env file
# uses: test-room-7/action-update-file@v1
# with:
# file: .env
# commit-message: "Update .env file with release version"
# branch: main
# github-token: ${{ secrets.GITHUB_TOKEN }}

# limit docker push image concurrency to 1
# to avoid github package return 429 ratelimit error
- name: Set docker upload concurrent
Expand All @@ -73,25 +65,26 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-

# - name: Log in to the Container registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# - name: Log in to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Matrix Build and push demo images
uses: docker/build-push-action@v3.1.1
with:
context: ./
file: ${{ matrix.file_tag.file }}
platforms: linux/amd64,linux/arm64
# for debug, remember remove this
#push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ env.DOCKERHUB_REPO }}:${{ env.RELEASE_VERSION }},${{ env.GHCR_REPO }}:${{ env.RELEASE_VERSION }},
Expand Down