Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/fix ci #576

Merged
merged 6 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ on:
push:
branches:
- "main"
- "chore/fix-ci"
pull_request:
branches:
- "main"
- "chore/fix-ci"

jobs:
docker:
runs-on: self-hosted
env:
DOCKER_BUILDKIT: 1

steps:
- name: Checkout
Expand Down Expand Up @@ -40,19 +44,37 @@ jobs:

- name: Get version from git tags
id: get_version
run: echo "VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_ENV
run: echo "VERSION=v$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_ENV

- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin

- name: Set up Docker Buildx
run: docker buildx create --use --driver cloud "neutronorg/neutron"
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: "lab:latest"
driver: cloud
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 }}
BUILDER: ${{ steps.buildx.outputs.name }}
run: |
DOCKER_BUILDKIT=1 make build-static-linux-amd64
docker buildx use $BUILDER
make build-static-linux-amd64
docker tag neutron-amd64:latest neutronorg/neutron:${{ env.VERSION }}
docker push neutronorg/neutron:${{ env.VERSION }}

Expand Down
Loading