Skip to content

Commit

Permalink
[Add] github nuget feed to dockerfile and update docker deployment GH…
Browse files Browse the repository at this point in the history
… action
  • Loading branch information
samatrhea committed May 12, 2024
1 parent d222f27 commit 2713041
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/publish-docker-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
Expand All @@ -22,21 +22,22 @@ jobs:

- name: Login to Docker Hub
if: github.ref_type == 'tag'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./COMETwebapp/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
secrets: |
"DEVEXPRESS_NUGET_KEY=${{ secrets.DEVEXPRESS_NUGET_KEY }}"
"PACKAGE_TOKEN=${{ secrets.PACKAGE_TOKEN }}"
- name: Invoke deployment hook
uses: distributhor/workflow-webhook@v3
env:
Expand Down
4 changes: 3 additions & 1 deletion COMETwebapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
COPY COMET.Web.Common COMET.Web.Common
COPY COMETwebapp COMETwebapp

RUN --mount=type=secret,id=DEVEXPRESS_NUGET_KEY export DEVEXPRESS_NUGET_KEY=$(cat /run/secrets/DEVEXPRESS_NUGET_KEY) \
RUN --mount=type=secret,id=DEVEXPRESS_NUGET_KEY --mount=type=secret,id=PACKAGE_TOKEN export DEVEXPRESS_NUGET_KEY=$(cat /run/secrets/DEVEXPRESS_NUGET_KEY) \
&& export PACKAGE_TOKEN=$(cat /run/secrets/PACKAGE_TOKEN) \
&& dotnet nuget add source https://nuget.devexpress.com/api -n DXFeed -u DevExpress -p ${DEVEXPRESS_NUGET_KEY} --store-password-in-clear-text \
&& dotnet nuget add source https://nuget.pkg.github.com/STARIONGROUP/index.json -n StarionGithubFeed -u STARIONGROUP -p ${PACKAGE_TOKEN} --store-password-in-clear-text \
&& dotnet restore COMETwebapp

RUN dotnet build COMETwebapp -c Release -o /app/build --no-restore
Expand Down

0 comments on commit 2713041

Please sign in to comment.