Skip to content

Commit

Permalink
[Add] github nuget feed secret and update GH action versions
Browse files Browse the repository at this point in the history
  • Loading branch information
samatrhea committed May 12, 2024
1 parent d222f27 commit 6c6b272
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 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 }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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 }}"
"DEVEXPRESS_NUGET_KEY=${{ secrets.DEVEXPRESS_NUGET_KEY }}"
- name: Invoke deployment hook
uses: distributhor/workflow-webhook@v3
env:
Expand Down
5 changes: 4 additions & 1 deletion COMETwebapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ 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=GITHUB_TOKEN \
&& export DEVEXPRESS_NUGET_KEY=$(cat /run/secrets/DEVEXPRESS_NUGET_KEY) \
&& export GITHUB_TOKEN=$(cat /run/secrets/GITHUB_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 StarionGroupNuget -u gh -p ${GITHUB_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 6c6b272

Please sign in to comment.