Skip to content

Commit

Permalink
Merge pull request #604 from neutron-org/chore/fix-ci
Browse files Browse the repository at this point in the history
Chore/fix ci
  • Loading branch information
keylogic1 authored Jun 27, 2024
2 parents a851380 + 57633d7 commit b5a30ef
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
tags:
- v*
- "*"
branches:
- "main"
- "releases/v3.x"
Expand All @@ -13,6 +13,12 @@ on:
- "main"
- "releases/v3.x"
- "chore/fix-ci"
workflow_dispatch:
inputs:
tag:
description: 'Tag to run the workflow for'
required: false
default: ''

jobs:
docker:
Expand All @@ -25,6 +31,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag || github.ref }}

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y jq curl git
Expand All @@ -46,9 +53,15 @@ jobs:
curl --silent -L --output ~/.docker/cli-plugins/docker-buildx $BUILDX_URL
chmod a+x ~/.docker/cli-plugins/docker-buildx
- name: Get version from git tags
- name: Get version from git tags or input
id: get_version
run: echo "VERSION=v$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_ENV
run: |
if [ -n "${{ github.event.inputs.tag }}" ]; then
VERSION=${{ github.event.inputs.tag }}
else
VERSION=$(git describe --tags --abbrev=0)
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
Expand All @@ -62,16 +75,6 @@ jobs:
endpoint: "neutronorg/neutron"
install: true

# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: .
# file: Dockerfile.builder
# tags: "${{ env.VERSION }}"
# # For pull requests, export results to the build cache.
# # Otherwise, push to a registry.
# outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }}

- name: Build and push Docker image
env:
VERSION: ${{ env.VERSION }}
Expand All @@ -84,4 +87,3 @@ jobs:
- name: Cleanup temporary container
run: docker rm -f neutronbinary || true

0 comments on commit b5a30ef

Please sign in to comment.