Skip to content

Docker Build Dotnet #88

Docker Build Dotnet

Docker Build Dotnet #88

Workflow file for this run

name: Docker Build Dotnet
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * 1'
env:
TZ: Asia/Shanghai
IMAGE_NAME: dotnet
IMAGE_TAGS: "latest 6 7 8 9"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: |
for tag in ${IMAGE_TAGS}; do
docker build . -f images/dotnet/${tag}/Dockerfile -t ${{ vars.DOCKER_REGISTRY }}/dockenv/dotnet:${tag}
docker build . -f images/aspnet/${tag}/Dockerfile -t ${{ vars.DOCKER_REGISTRY }}/dockenv/aspnet:${tag}
done
- name: Login to Docker Registry
run: |
docker login -u ${{vars.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ vars.DOCKER_REGISTRY }}
- name: Push Docker Image
run: |
for tag in ${IMAGE_TAGS}; do
docker push ${{ vars.DOCKER_REGISTRY }}/dockenv/dotnet:${tag}
docker push ${{ vars.DOCKER_REGISTRY }}/dockenv/aspnet:${tag}
done