Skip to content

Commit

Permalink
Refactor GitHub Actions workflow and add GITHUB_TOKEN input
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalvesj committed Oct 21, 2024
1 parent e646836 commit 0e1b66e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/actions/publish-dotnet-container/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ inputs:
dotnet-version:
required: true
description: ""
token:
description: 'github auth token (PAT, github token, or GitHub app token)'
required: true
default: ""

runs:
using: "composite"
steps:
Expand All @@ -16,13 +21,11 @@ runs:
dotnet-version: ${{ inputs.dotnet-version }}

- name: Login to GitHub Packages
uses: docker/login-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: $GITHUB_TOKEN
password: ${{ inputs.token }}

- name: Publish
shell: bash
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/app-service-private-endpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Publish .Net App
uses: ./.github/actions/publish-dotnet-container
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/publish-dotnet-container
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}

# deploy-to-ghcr:
# uses: ./.github/workflows/reusable-push-to-ghcr.yml
Expand Down

0 comments on commit 0e1b66e

Please sign in to comment.