Skip to content

Commit

Permalink
revert: Push docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
alex289 committed Dec 6, 2023
1 parent 066f650 commit 669989c
Showing 1 changed file with 2 additions and 33 deletions.
35 changes: 2 additions & 33 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: CI/CD

on:
workflow_dispatch:
inputs:
release:
type: boolean
description: 'Create a new release'
required: true
default: false
push:
branches: [ main ]
pull_request:
Expand All @@ -25,60 +19,35 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.x.x
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal

cd:
runs-on: ubuntu-latest
needs: ci
if: github.event_name == 'workflow_dispatch' && ${{ github.event.inputs.release != 'false' }}
if: github.ref == 'refs/heads/main'
steps:
- 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.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Read Version
id: read_version
run: echo ::set-output name=VERSION::$(jq -r '.version' version.json)

- name: Build and push
uses: docker/build-push-action@v5
with:
# platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.DOCKER_IMAGE }}:${{ steps.read_version.outputs.VERSION }}, ${{ env.DOCKER_IMAGE }}:latest

- name: Create and Push Tag
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git tag -a v${{ steps.read_version.outputs.VERSION }} -m "Version ${{ steps.read_version.outputs.VERSION }}"
git push origin v${{ steps.read_version.outputs.VERSION }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
title: v${{ steps.read_version.outputs.VERSION }}
tag_name: v${{ steps.read_version.outputs.VERSION }}
generate_release_notes: true
tags: ${{ env.DOCKER_IMAGE }}:latest

0 comments on commit 669989c

Please sign in to comment.