Update dependency Npgsql.EntityFrameworkCore.PostgreSQL to v7 #226
Workflow file for this run
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: Build | |
on: | |
push: | |
paths-ignore: | |
- '.github/workflows/**' | |
workflow_dispatch: | |
jobs: | |
cloc: | |
name: CLOC | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: Install cloc | |
run: sudo apt update && sudo apt install cloc -y | |
- name: Print lines of code | |
run: | | |
cloc --include-lang \ | |
C#,SQL,Razor,"Bourne Shell",PowerShell,HTML,CSS,Sass,JavaScript,TypeScript \ | |
--vcs git | |
build-artifacts: | |
name: Build artifacts | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: Print environment | |
run: | | |
whoami | |
dotnet --info | |
echo "GitHub ref: $GITHUB_REF" | |
echo "GitHub event: $GITHUB_EVENT" | |
- name: Restore/Clean service | |
working-directory: ./src/KeyConnector | |
run: | | |
echo "Restore" | |
dotnet restore | |
echo "Clean" | |
dotnet clean -c "Release" -o obj/build-output/publish | |
- name: Publish service | |
working-directory: ./src/KeyConnector | |
run: | | |
echo "Publish" | |
dotnet publish -c "Release" -o obj/build-output/publish | |
cd obj/build-output/publish | |
zip -r KeyConnector.zip . | |
mv KeyConnector.zip ../../../ | |
pwd | |
ls -atlh ../../../ | |
- name: Upload service artifact | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: KeyConnector.zip | |
path: ./src/KeyConnector/KeyConnector.zip | |
if-no-files-found: error | |
build-docker: | |
name: Build Docker images | |
runs-on: ubuntu-20.04 | |
needs: build-artifacts | |
env: | |
_SERVICE_NAME: key-connector | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: Setup DCT | |
id: setup-dct | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' | |
uses: bitwarden/gh-actions/setup-docker-trust@8fccdaea2810d5dfb13753b6dd93bbd3a63ff82e | |
with: | |
azure-creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} | |
azure-keyvault-name: "bitwarden-ci" | |
- name: Get build artifact | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: KeyConnector.zip | |
- name: Setup build artifact | |
run: | | |
mkdir -p ./src/KeyConnector/obj/build-output/publish | |
unzip KeyConnector.zip \ | |
-d ./src/KeyConnector/obj/build-output/publish | |
- name: Build Docker images | |
run: | | |
docker build -t ${{ env._SERVICE_NAME }} \ | |
./src/KeyConnector | |
- name: Tag and Push RC to Docker Hub | |
if: (github.ref == 'refs/heads/rc') | |
env: | |
DOCKER_CONTENT_TRUST: 1 | |
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }} | |
run: | | |
docker tag ${{ env._SERVICE_NAME }} \ | |
bitwarden/${{ env._SERVICE_NAME }}:rc | |
docker push bitwarden/${{ env._SERVICE_NAME }}:rc | |
- name: Tag and Push Hotfix to Docker Hub | |
if: (github.ref == 'refs/heads/hotfix-rc') | |
env: | |
DOCKER_CONTENT_TRUST: 1 | |
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }} | |
run: | | |
docker tag ${{ env._SERVICE_NAME }} \ | |
bitwarden/${{ env._SERVICE_NAME }}:hotfix | |
docker push bitwarden/${{ env._SERVICE_NAME }}:hotfix | |
- name: Tag and Push Dev to Docker Hub | |
if: (github.ref == 'refs/heads/master') | |
env: | |
DOCKER_CONTENT_TRUST: 1 | |
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }} | |
run: | | |
docker tag ${{ env._SERVICE_NAME }} \ | |
bitwarden/${{ env._SERVICE_NAME }}:dev | |
docker push bitwarden/${{ env._SERVICE_NAME }}:dev | |
- name: Log out of Docker and disable Docker Notary | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' | |
run: | | |
docker logout | |
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV |