Skip to content

Commit

Permalink
chore: Revert action changes
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-paliychuk committed Sep 25, 2024
1 parent 7222595 commit fe2e2ef
Showing 1 changed file with 12 additions and 35 deletions.
47 changes: 12 additions & 35 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ on:
push:
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
workflow_dispatch:
inputs:
tag:
description: 'Tag to build and publish'
required: true
push_as_latest:
description: 'Also push as latest?'
type: boolean
default: false

env:
REGISTRY: docker.io
Expand All @@ -24,15 +15,10 @@ jobs:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout repo for tag push
if: github.event_name == 'push'
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Checkout repo for manual trigger
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
ref: ${{ github.event.inputs.tag || github.ref }}

- name: Set up Depot CLI
uses: depot/setup-action@v1
Expand All @@ -43,33 +29,24 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract version from tag
id: get_version
run: |
VERSION=${{ github.event.inputs.tag || github.ref_name }}
VERSION=${VERSION#v} # Remove leading 'v' if present
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "major_minor=${VERSION%.*}" >> $GITHUB_OUTPUT
echo "major=${VERSION%%.*}" >> $GITHUB_OUTPUT
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_as_latest == 'true') }}
type=raw,value=${{ steps.get_version.outputs.version }}
type=raw,value=${{ steps.get_version.outputs.major_minor }}
type=raw,value=${{ steps.get_version.outputs.major }}
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Build and push
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=match,pattern=v(.*-beta),group=1
type=match,pattern=v.*-(beta),group=1
- name: Depot build and push image
uses: depot/build-push-action@v1
with:
context: ${{ github.workspace }}
push: true
project: v9jv1mlpwc
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags || env.TAGS }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down

0 comments on commit fe2e2ef

Please sign in to comment.