diff --git a/.github/workflows/docker-manual.yml b/.github/workflows/docker-manual.yml deleted file mode 100644 index 84bb51f..0000000 --- a/.github/workflows/docker-manual.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Push to GHCR (Manual) - -on: - workflow_dispatch: - inputs: - tag: - required: true - description: "Build specific tag" - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.tag }} - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build & push - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: | - ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7b0d264..21cef48 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,16 +1,31 @@ name: Push to GHCR on: - release: - types: - - created + push: + tags: + - '*' + workflow_dispatch: + inputs: + tag: + required: true + description: "Build specific tag" jobs: docker: runs-on: ubuntu-latest steps: + - name: Set tag name from manual dispatch + if: ${{ github.event_name == "workflow_dispatch" }} + run: | + echo "tag_name=${{ github.event.inputs.tag }}" >> $GITHUB_ENV + - name: Set tag name from Git + if: ${{ github.event_name == "push" }} + run: | + echo "tag_name=${{ github.ref_name }}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ env.tag_name }} - name: Set up Buildx uses: docker/setup-buildx-action@v1 - name: Login to registry @@ -27,4 +42,4 @@ jobs: push: true tags: | ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} + ghcr.io/${{ github.repository }}:${{ env.tag_name }}