Skip to content

Commit

Permalink
refactor(dir): ♻️🚧 disable package.lock and GH Actions cache for Depe…
Browse files Browse the repository at this point in the history
  • Loading branch information
collinbarrett committed Jun 15, 2024
1 parent 8e8428a commit 20bf8d0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1,190 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/directory-migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
env:
USER_NAME: github-actions[bot]
USER_EMAIL: github-actions[bot]@users.noreply.github.com
LINT_MESSAGE: 'chore(dir-data): 🎨 lint PR #${{ github.event.number }}'
MIGRATION_MESSAGE: 'chore(dir-data): ♻️ migrate PR #${{ github.event.number }}'
LINT_MESSAGE: "chore(dir-data): 🎨 lint PR #${{ github.event.number }}"
MIGRATION_MESSAGE: "chore(dir-data): ♻️ migrate PR #${{ github.event.number }}"
TEST_MSSQL_IMAGE: mcr.microsoft.com/mssql/server:2022-latest

steps:
Expand All @@ -31,7 +31,7 @@ jobs:
with:
ref: ${{ github.head_ref }}
fetch-depth: 50 # guess max depth for data migration branch to avoid fetching all while still allowing sync w/upstream

- name: Lint
run: ./lint.sh
working-directory: ./services/Directory/data
Expand Down Expand Up @@ -61,18 +61,19 @@ jobs:
git revert --no-edit $PREVIOUS_MIGRATION_HASH
fi
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
cache-dependency-path: services/Directory/FilterLists.Directory.Api/packages.lock.json
cache: true
# Disabled GH Actions cache for Dependabot. https://github.com/dependabot/dependabot-core/issues/1303
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# cache-dependency-path: services/Directory/FilterLists.Directory.Api/packages.lock.json
# cache: true

- name: Install dotnet-ef
run: dotnet tool install --global dotnet-ef

- name: Restore
run: dotnet restore --locked-mode
working-directory: ./services/Directory/FilterLists.Directory.Api
# - name: Restore
# run: dotnet restore --locked-mode
# working-directory: ./services/Directory/FilterLists.Directory.Api

- name: Add Migration
run: >
Expand Down Expand Up @@ -122,4 +123,4 @@ jobs:
working-directory: ./services/Directory

- name: git push
run: git push
run: git push
21 changes: 11 additions & 10 deletions .github/workflows/directory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
jobs:
build:
name: Build

runs-on: ubuntu-latest

permissions:
Expand All @@ -37,15 +37,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
cache-dependency-path: services/Directory/FilterLists.Directory.Api/packages.lock.json
cache: true
# Disabled GH Actions cache for Dependabot. https://github.com/dependabot/dependabot-core/issues/1303
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# cache-dependency-path: services/Directory/FilterLists.Directory.Api/packages.lock.json
# cache: true

- name: Restore
run: dotnet restore --locked-mode
working-directory: ./services/Directory/FilterLists.Directory.Api
# - name: Restore
# run: dotnet restore --locked-mode
# working-directory: ./services/Directory/FilterLists.Directory.Api

- name: Build
run: dotnet build -c Release
Expand Down Expand Up @@ -91,4 +92,4 @@ jobs:
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_APP_FILTERLISTS_DIRECTORY_PROD }}
images: ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_REPOSITORY }}:${{ env.CONTAINER_IMAGE_TAG_UNIQUE }}
images: ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_REPOSITORY }}:${{ env.CONTAINER_IMAGE_TAG_UNIQUE }}
10 changes: 5 additions & 5 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

environment:
name: staging-web
url: ${{ steps.builddeploy.outputs.static_web_app_url }}
url: ${{ steps.builddeploy.outputs.static_web_app_url }}

steps:
- name: Checkout
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: ./web/build
output_location: ''
output_location: ""
skip_app_build: true
continue-on-error: true

Expand All @@ -79,7 +79,7 @@ jobs:

environment:
name: production-web
url: https://filterlists.com
url: https://filterlists.com

steps:
- name: Checkout
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: ./web/build
output_location: ''
output_location: ""
skip_app_build: true

close_pull_request:
Expand All @@ -128,4 +128,4 @@ jobs:
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }}
action: close
app_location: ./web
app_location: ./web
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
</PropertyGroup>

<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<!-- Disabled GH Actions cache for Dependabot. https://github.com/dependabot/dependabot-core/issues/1303 -->
<!-- <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> -->

<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
<ContainerBaseImage>mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled-extra</ContainerBaseImage>
Expand Down
Loading

0 comments on commit 20bf8d0

Please sign in to comment.