Skip to content

Commit

Permalink
Update main_build-aspnetcore.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceMcCarthy committed Feb 16, 2024
1 parent 286b893 commit d6f778b
Showing 1 changed file with 8 additions and 26 deletions.
34 changes: 8 additions & 26 deletions .github/workflows/main_build-aspnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ jobs:
cd src/AspNetCore/MyAspNetCoreApp/wwwroot/js
echo ${{ steps.akeyless.outputs.KENDO_LICENSE_FILE }} > kendo-ui-license.js
- name: Generate a version number for new tag
id: tag-creator
run: |
buildDay=`date +%Y.%m.%d`
tags="lancemccarthy/myaspnetcoreapp:$buildDay.$GITHUB_RUN_NUMBER"
echo "DOCKER_HUB_TAG=$tags" >> $GITHUB_OUTPUT
- name: Verify tag output
run: echo ${{ steps.tag-creator.outputs.DOCKER_HUB_TAG }}

Expand Down Expand Up @@ -86,7 +79,6 @@ jobs:
secrets: |
telerik_key=${{ steps.akeyless.outputs.TELERIK_NUGET_KEY }}
tags: |
${{ steps.tag-creator.outputs.DOCKER_HUB_TAG }}
lancemccarthy/myaspnetcoreapp:latest
Expand All @@ -110,13 +102,6 @@ jobs:
with:
fetch-depth: 0

- name: Generate tag version
id: tag-creator
run: |
buildDay=`date +%Y.%m.%d`
tags="$buildDay.$GITHUB_RUN_NUMBER"
echo "VERSION_TAG=$tags" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
run: docker login ghcr.io -u ${{github.actor}} -p ${{secrets.GITHUB_TOKEN}}

Expand All @@ -130,11 +115,13 @@ jobs:
id: build
working-directory: ${{env.WORKING_DIRECTORY}}
run: |
TAG="latest-${{env.target_arch}}"
# Build and publish arch-specific container
dotnet publish ${{env.PROJECT_PATH}} -t:PublishContainer -p PublishProfile=DefaultContainer --arch ${{env.target_arch}} -p ContainerImageTag="${{steps.tag-creator.outputs.VERSION_TAG}}-${{env.target_arch}}" -p ContainerRepository="lancemccarthy/myaspnetcoreapp" -p ContainerRegistry="ghcr.io" -p ContainerBaseImage=${{env.CONTAINER_BASE_IMAGE}} --no-restore
dotnet publish ${{env.PROJECT_PATH}} -t:PublishContainer -p PublishProfile=DefaultContainer --arch ${{env.target_arch}} -p ContainerImageTag="$TAG" -p ContainerRepository="lancemccarthy/myaspnetcoreapp" -p ContainerRegistry="ghcr.io" -p ContainerBaseImage=${{env.CONTAINER_BASE_IMAGE}} --no-restore
# Job output the arch-specific container name so we can publish a multi-arch image later
echo "build_tag=${{steps.tag-creator.outputs.VERSION_TAG}}-${{env.target_arch}}" >> $GITHUB_OUTPUT
echo "build_tag=$TAG" >> $GITHUB_OUTPUT
build_arm64:
runs-on: ubuntu-22.04
Expand All @@ -151,13 +138,6 @@ jobs:
with:
fetch-depth: 0

- name: Generate tag version
id: tag-creator
run: |
buildDay=`date +%Y.%m.%d`
tags="$buildDay.$GITHUB_RUN_NUMBER"
echo "VERSION_TAG=$tags" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
run: docker login ghcr.io -u ${{github.actor}} -p ${{secrets.GITHUB_TOKEN}}

Expand All @@ -171,11 +151,13 @@ jobs:
id: build
working-directory: ${{env.WORKING_DIRECTORY}}
run: |
TAG="latest-${{env.target_arch}}"
# Build and publish arch-specific container
dotnet publish ${{env.PROJECT_PATH}} -t:PublishContainer -p PublishProfile=DefaultContainer --arch ${{env.target_arch}} -p ContainerImageTag="${{steps.tag-creator.outputs.VERSION_TAG}}-${{env.target_arch}}" -p ContainerRepository="lancemccarthy/myaspnetcoreapp" -p ContainerRegistry="ghcr.io" -p ContainerBaseImage=${{env.CONTAINER_BASE_IMAGE}} --no-restore
dotnet publish ${{env.PROJECT_PATH}} -t:PublishContainer -p PublishProfile=DefaultContainer --arch ${{env.target_arch}} -p ContainerImageTag="$TAG" -p ContainerRepository="lancemccarthy/myaspnetcoreapp" -p ContainerRegistry="ghcr.io" -p ContainerBaseImage=${{env.CONTAINER_BASE_IMAGE}} --no-restore
# Job output the arch-specific container name so we can publish a multi-arch image later
echo "build_tag=${{steps.tag-creator.outputs.VERSION_TAG}}-${{env.target_arch}}" >> $GITHUB_OUTPUT
echo "build_tag=$TAG" >> $GITHUB_OUTPUT
publish_combined_manifest:
runs-on: ubuntu-22.04
Expand Down

0 comments on commit d6f778b

Please sign in to comment.