diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4fbfdee7..5a7cf042 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,6 +32,9 @@ jobs: container-image: name: 'Build container image' runs-on: ubuntu-24.04 + permissions: + contents: read + packages: write needs: - extract-version steps: @@ -42,18 +45,19 @@ jobs: files: '["**/environment.prod.ts"]' env: TOKEN_APPLICATION_VERSION: "${{ needs.extract-version.outputs.turnierplan_version }}" - - name: Login to Docker Hub + - name: Login to container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: 'Build and push container image' uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: context: ./src file: ./src/Turnierplan.App/Dockerfile push: true - tags: '${{ vars.DOCKER_HUB_REPOSITORY }}:latest,${{ vars.DOCKER_HUB_REPOSITORY }}:${{ needs.extract-version.outputs.turnierplan_version }}' + tags: 'ghcr.io/turnierplan-net/turnierplan:latest,ghcr.io/turnierplan-net/turnierplan:${{ needs.extract-version.outputs.turnierplan_version }}' nuget-package: name: 'Build NuGet package' diff --git a/README.md b/README.md index 712ead0c..bb33517d 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ This readme describes how to deploy the application using the pre-built containe ## Deployment -**turnierplan.NET** comes as a pre-built container image which can be deployed with minimal configuration. The image is available on [Docker Hub](https://hub.docker.com/r/eliaspr/turnierplan-net). +**turnierplan.NET** comes as a pre-built container image which can be deployed with minimal configuration. The image is available on GitHub: [ghcr.io/turnierplan-net/turnierplan](https://github.com/turnierplan-NET/turnierplan.NET/pkgs/container/turnierplan) In the simplest case, run the container directly using the following command. Make sure to substitute the correct PostgreSQL database connection string: ```shell -docker run -p 80:8080 -e ApplicationUrl="http://localhost" -e Database__ConnectionString="" eliaspr/turnierplan-net:latest +docker run -p 80:8080 -e ApplicationUrl="http://localhost" -e Database__ConnectionString="" ghcr.io/turnierplan-net/turnierplan:latest ``` The credentials of the initial admin user are displayed in the container logs. @@ -69,7 +69,7 @@ services: restart: unless-stopped turnierplan.app: - image: eliaspr/turnierplan-net:latest + image: ghcr.io/turnierplan-net/turnierplan:latest depends_on: - turnierplan.database environment: