diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index a624ffc..9ac4718 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -16,8 +16,6 @@ jobs: build-images: runs-on: ubuntu-latest name: Build Docker images for Azure Container Registry and GitHub Container Registry - environment: - name: build permissions: contents: read packages: write @@ -27,34 +25,18 @@ jobs: with: fetch-depth: 0 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ secrets.GH_REGISTRY_URL }}/${{ env.IMAGE_NAME }},${{ secrets.AZURE_REGISTRY_URL }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=sha,format=long,suffix=,prefix= + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: ACR authentication - uses: azure/docker-login@v2 - with: - login-server: ${{ secrets.AZURE_REGISTRY_URL }} - username: ${{ secrets.AZURE_REGISTRY_USERNAME }} - password: ${{ secrets.AZURE_REGISTRY_PASSWORD }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: GPR authentication - uses: azure/docker-login@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 with: - login-server: ${{ secrets.GH_REGISTRY_URL }} + registry: ghcr.io/sarathkrishnamurthy/httpstatus username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 @@ -62,27 +44,6 @@ jobs: context: . file: src/Teapot.Web/Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ghcr.io/sarathkrishnamurthy/httpstatus:test5 + labels: test-label platforms: linux/amd64,linux/arm64 - - deploy-azure: - runs-on: ubuntu-latest - name: Deploy to Azure - environment: - name: production - needs: [build-images] - - steps: - - name: Azure authentication - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Deploy to Azure WebApp - uses: azure/webapps-deploy@v3 - with: - app-name: ${{ env.AZURE_WEBAPP_NAME }} - images: ${{ secrets.AZURE_REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ github.sha }} diff --git a/src/Teapot.Web/Dockerfile b/src/Teapot.Web/Dockerfile index 543a7cc..3db683d 100644 --- a/src/Teapot.Web/Dockerfile +++ b/src/Teapot.Web/Dockerfile @@ -1,6 +1,6 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS base +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443