Update BadBlock links, reflect username change, & add new BadBlock lists #241
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: Directory API - Build & Deploy | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/directory.yml | |
- services/Directory/** | |
- services/FilterLists.ServiceDefaults/** | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/directory.yml | |
- services/Directory/** | |
- services/FilterLists.ServiceDefaults/** | |
env: | |
CONTAINER_REGISTRY: ghcr.io | |
CONTAINER_REPOSITORY: collinbarrett/filterlists-directory-api | |
CONTAINER_IMAGE_TAG_UNIQUE: ${{ github.run_id }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
env: | |
CONTAINER_IMAGE_TAG_STABLE: latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# 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: Build | |
run: dotnet build -c Release | |
working-directory: ./services/Directory/FilterLists.Directory.Api | |
- name: Login to Container Registry | |
if: github.event_name == 'push' | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.CONTAINER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish & Push | |
if: github.event_name == 'push' | |
run: > | |
dotnet publish --sc | |
-p:PublishProfile=DefaultContainer | |
-p:ContainerRegistry=${{ env.CONTAINER_REGISTRY }} | |
-p:ContainerRepository=${{ env.CONTAINER_REPOSITORY }} | |
-p:ContainerImageTags='"${{ env.CONTAINER_IMAGE_TAG_UNIQUE }};${{ env.CONTAINER_IMAGE_TAG_STABLE }}"' | |
working-directory: ./services/Directory/FilterLists.Directory.Api | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.event_name == 'push' | |
env: | |
AZURE_WEBAPP_NAME: app-filterlists-directory-prod | |
environment: | |
name: production-directory-api | |
url: https://api.filterlists.com | |
steps: | |
- name: Deploy to Azure | |
uses: azure/webapps-deploy@v3 | |
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 }} |