Deploy #205
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: Deploy | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build for ARM64 | |
run: dotnet publish misc/Ae.Dns.Console/Ae.Dns.Console.csproj --configuration Release --runtime linux-arm64 --output build/linux/arm64 | |
- name: Build for AMD64 | |
run: dotnet publish misc/Ae.Dns.Console/Ae.Dns.Console.csproj --configuration Release --runtime linux-x64 --output build/linux/amd64 | |
- name: Login to Public ECR | |
uses: docker/login-action@v1 | |
with: | |
registry: public.ecr.aws | |
username: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Push to ECR | |
env: | |
IMAGE_TAG: ${{ github.sha }} | |
run: | | |
docker build --platform=linux/arm64 -t public.ecr.aws/j7m3k0v4/aedns:$IMAGE_TAG-linux-arm64 . | |
docker build --platform=linux/arm64 -t public.ecr.aws/j7m3k0v4/aedns:latest-linux-arm64 . | |
docker build --platform=linux/amd64 -t public.ecr.aws/j7m3k0v4/aedns:$IMAGE_TAG-linux-amd64 . | |
docker build --platform=linux/amd64 -t public.ecr.aws/j7m3k0v4/aedns:latest-linux-amd64 . | |
docker push --all-tags public.ecr.aws/j7m3k0v4/aedns | |
docker manifest create public.ecr.aws/j7m3k0v4/aedns:latest \ | |
--amend public.ecr.aws/j7m3k0v4/aedns:$IMAGE_TAG-linux-arm64 \ | |
--amend public.ecr.aws/j7m3k0v4/aedns:$IMAGE_TAG-linux-amd64 | |
docker manifest push public.ecr.aws/j7m3k0v4/aedns:latest |