v0.0.12 #13
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 Docker Image | |
on: | |
release: | |
types: [ created ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Variable Substitution in appsettings.json | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: '**/appsettings.json' | |
env: | |
MassTransit.Transport.Port: 23501 | |
MassTransit.Transport.Username: ${{ secrets.RABBITMQ_USERNAME }} | |
MassTransit.Transport.Password: ${{ secrets.RABBITMQ_PASSWORD }} # configure your variables substitution here | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Convert Repository Name to Lowercase | |
run: | | |
lowercase_name=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]') | |
echo "lowercase_repo_name=$lowercase_name" >> $GITHUB_ENV | |
- name: Build and Push Docker Image | |
run: | | |
docker build -f ./${{ github.event.repository.name }}/Dockerfile -t ghcr.io/trumpee/trumpee-${{ env.lowercase_repo_name }}:${{ github.event.release.tag_name}} --build-arg NUGET_API_KEY=${{ secrets.SECRET_TOKEN }} --build-arg SOLUTION_NAME=${{ github.event.repository.name }} . | |
docker tag ghcr.io/trumpee/trumpee-${{ env.lowercase_repo_name }}:${{ github.event.release.tag_name}} ghcr.io/trumpee/trumpee-${{ env.lowercase_repo_name }}:latest | |
docker push ghcr.io/trumpee/trumpee-${{ env.lowercase_repo_name }} --all-tags |