Skip to content

fix(src/knifehub.web): dotnet publish --framework net6.0, 1.5.5 #26

fix(src/knifehub.web): dotnet publish --framework net6.0, 1.5.5

fix(src/knifehub.web): dotnet publish --framework net6.0, 1.5.5 #26

name: Docker Image CI/CD - Release - knifehub-amd-chrome
on:
# release:
# types: [published]
push:
tags:
- 'KnifeHub-v*'
jobs:
# build and push
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set outputs
id: vars
run: |
#echo ::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
# 去掉前面的 refs/tags/knifehub-
echo ::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF:19})
echo ::set-output name=IMAGE_NAME::knifehub
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Registry - Docker Hub
run: docker login --username=${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
- name: Build Image and Push - Docker Hub
# push: RELEASE_VERSION
run: |
docker buildx build \
--platform=linux/amd64 \
--output "type=image,push=true" \
--file src/KnifeHub.Web/Dockerfile.amd-chrome \
--tag ${{ secrets.DOCKER_USERNAME }}/${{ steps.vars.outputs.IMAGE_NAME }}:${{ steps.vars.outputs.RELEASE_VERSION }}-amd-chrome \
.
- name: Build Image and Push - latest - Docker Hub
# push: latest
run: |
docker buildx build \
--platform=linux/amd64 \
--output "type=image,push=true" \
--file src/KnifeHub.Web/Dockerfile.amd-chrome \
--tag ${{ secrets.DOCKER_USERNAME }}/${{ steps.vars.outputs.IMAGE_NAME }}:latest-amd-chrome \
.
- name: Login to Registry - ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Image and Push - ghcr.io
# push: RELEASE_VERSION
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.IMAGE_NAME }}
VERSION=${{ steps.vars.outputs.RELEASE_VERSION }}
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker buildx build \
--platform=linux/amd64 \
--output "type=image,push=true" \
--file src/KnifeHub.Web/Dockerfile.amd-chrome \
--tag $IMAGE_ID:$VERSION-amd-chrome \
.
- name: Build Image and Push - latest - ghcr.io
# push: latest
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.IMAGE_NAME }}
echo IMAGE_ID=$IMAGE_ID
docker buildx build \
--platform=linux/amd64 \
--output "type=image,push=true" \
--file src/KnifeHub.Web/Dockerfile.amd-chrome \
--tag $IMAGE_ID:latest-amd-chrome \
.