Skip to content

Commit

Permalink
Merge pull request #2 from 1kx-network/feature/cicd
Browse files Browse the repository at this point in the history
Combined Docker-related workflows
  • Loading branch information
mikery authored Mar 18, 2024
2 parents 90e699b + 0b72781 commit 51eb7e8
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 85 deletions.
67 changes: 49 additions & 18 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,61 @@ name: docker-image-ci
on:
push:
branches:
- "main"
- "main"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
- "develop"
branches:
- "main"
- "develop"

jobs:
push-image:
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
if: ${{ !env.ACT }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}

- uses: actions/checkout@v2
- name: Build & Publish the Docker image
if: ${{ !env.ACT }}
run: |
docker build . --file Dockerfile --tag ghcr.io/covalenthq/bsp-geth:latest
docker push ghcr.io/covalenthq/bsp-geth:latest
- name: Log in to the Container registry
if: ${{ !env.ACT }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Login to GCR
# if: ${{ !env.ACT }}
# uses: docker/login-action@v3
# with:
# registry: gcr.io
# username: _json_key
# password: ${{ secrets.GCR_JSON_KEY }}
- name: Checkout
uses: actions/checkout@v2
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v4
with:
# images: ghcr.io/${{ github.repository }},gcr.io/covalent-project/bsp-geth
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ env.ACT && 'false' || 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
- name: Create release
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: false

# - name: Start containers
# run: docker-compose -f "docker-compose.yml" up --build --remove-orphans --force-recreate --exit-code-from agent
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/gcr-image.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/tag-release.yaml

This file was deleted.

0 comments on commit 51eb7e8

Please sign in to comment.