Update app version #39
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: CI | |
on: | |
push: | |
tags: | |
- '**' | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tag: | |
required: true | |
description: 'Output image tag' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Install .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Set Runtime Identifier | |
id: set_rid | |
run: | | |
if [[ "$RUNNER_ARCH" == "X64" ]]; then | |
echo "RID=linux-x64" >> $GITHUB_ENV | |
else | |
echo "RID=linux-arm64" >> $GITHUB_ENV | |
fi | |
- name: Restore Dependencies | |
run: dotnet restore --runtime ${{ env.RID }} | |
- name: Build and Publish | |
run: dotnet publish ./UI/MTWireGuard.csproj -c Release -o publish --runtime ${{ env.RID }} --no-restore --self-contained true /p:WarningLevel=0 /p:PublishTrimmed=true | |
- name: Define Tags | |
id: define-tags | |
run: | | |
if [ "${{ github.event_name }}" == "push" ]; then | |
echo "tags=techgarageir/mtwireguard:${{ github.ref_name }}, techgarageir/mtwireguard:latest, ghcr.io/${{ github.repository_owner }}/mtwireguard:${{ github.ref_name }}, ghcr.io/${{ github.repository_owner }}/mtwireguard:latest" >> $GITHUB_ENV | |
else | |
echo "tags=techgarageir/mtwireguard:${{ github.event.inputs.tag }}, ghcr.io/${{ github.repository_owner }}/mtwireguard:${{ github.event.inputs.tag }}" >> $GITHUB_ENV | |
fi | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v6 | |
env: | |
IMAGE_NAME: "techgarageir/mtwireguard" | |
GHCR_IMAGE_NAME: "ghcr.io/${{ github.repository_owner }}/mtwireguard" | |
with: | |
platforms: linux/amd64 | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ env.tags }} | |
- name: Debug Output | |
run: | | |
echo "Event Name: ${{ github.event_name }}" | |
echo "Ref Name: ${{ github.ref_name }}" | |
echo "Tag Input: ${{ github.event.inputs.tag }}" | |
echo "Defined Tags: ${{ env.tags }}" |