Update Dockerfile #66
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: Build ASP.NET Core and Reporting REST Service | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- "aspnetcore/*" | |
paths: | |
- 'src/AspNetCore/**/*' | |
- '.github/workflows/main_build-aspnetcore.yml' | |
jobs: | |
# A job that containerizes an ASP.NET Core web app with Relerik Reporting REST service and publish to Docker Hub | |
build_aspnetcore: | |
runs-on: ubuntu-22.04 | |
# REQUIRED For 'akeyless' step | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# I am getting all my secrets from AKeyless (you can use GitHub Actions secrets) | |
- name: Fetch secrets from AKeyless | |
id: akeyless | |
uses: LanceMcCarthy/akeyless-action@v3 | |
with: | |
access-id: ${{ secrets.AKEYLESS_JWT_ID }} | |
static-secrets: '{"/personal-keys/mccarthy/TELERIK_NUGET_KEY":"TELERIK_NUGET_KEY", "/personal-keys/mccarthy/DOCKER_HUB_USERNAME":"DOCKER_HUB_USERNAME", "/personal-keys/mccarthy/DOCKER_HUB_PAT":"DOCKER_HUB_PAT"}' | |
export-secrets-to-outputs: true | |
export-secrets-to-environment: false | |
- 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 }} | |
- name: Get package metadata from Docker Hub | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: lancemccarthy/myaspnetcoreapp | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ steps.akeyless.outputs.DOCKER_HUB_USERNAME }} | |
password: ${{ steps.akeyless.outputs.DOCKER_HUB_PAT }} | |
- name: Build and push to Docker Hub | |
uses: docker/build-push-action@v3 | |
with: | |
context: src/AspNetCore/MyAspNetCoreApp | |
push: true | |
secrets: | | |
telerik_key=${{ steps.akeyless.outputs.TELERIK_NUGET_KEY }} | |
tags: | | |
${{ steps.tag-creator.outputs.DOCKER_HUB_TAG }} | |
lancemccarthy/myaspnetcoreapp:latest |