Skip to content

v0.0.12

v0.0.12 #13

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