Skip to content

Commit

Permalink
Merge pull request #11 from kilnfi/isma/pgeth-monitoring-env
Browse files Browse the repository at this point in the history
fix: add build ci to ensure build at new push
  • Loading branch information
Doozers authored Jan 16, 2024
2 parents 5d9bdb4 + b5c3ffd commit b9a7f07
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build

on:
push:
branches:
- "pgeth"

permissions: write-all

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "generate:build_id"
run: |
branch=${GITHUB_REF##*/}
sha=${GITHUB_SHA::8}
ts=$(date +%s)
echo "BUILD_ID=${branch}-${sha}-${ts}" >> $GITHUB_ENV
- name: "build the docker image"
run: docker build -f Dockerfile.plugins . --tag "ghcr.io/kilnfi/pgeth:${{ env.BUILD_ID }}" --tag ghcr.io/kilnfi/pgeth:latest --tag ghcr.io/kilnfi/pgeth:${GITHUB_SHA}
- name: "login to ghcr"
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "push to ghcr"
run: |
docker push ghcr.io/kilnfi/pgeth:latest
docker push ghcr.io/kilnfi/pgeth:${GITHUB_SHA}
18 changes: 0 additions & 18 deletions .github/workflows/sync-and-build-plugins.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: sync

on:
push:
branches:
- "pgeth"
schedule:
- cron: "0 * * * *" # every hour
workflow_dispatch:

permissions: write-all

Expand All @@ -25,24 +21,10 @@ jobs:
- name: "check if diff exists"
id: diffcheck
run: echo "stdout=$(git diff master geth/master -- | wc -c)" >> $GITHUB_OUTPUT

- name: "generate:build_id"
run: |
branch=${GITHUB_REF##*/}
sha=${GITHUB_SHA::8}
ts=$(date +%s)
echo "BUILD_ID=${branch}-${sha}-${ts}" >> $GITHUB_ENV
if: github.event_name == 'push'
- name: "generate:build_id"
run: |
echo "BUILD_ID=${{ github.event.release.name }}" >> $GITHUB_ENV
if: github.event_name == 'release'
- name: "generate:build_id"
run: |
ts=$(date +%d%m%Y-%H%M%S)
echo "BUILD_ID=auto-${ts}" >> $GITHUB_ENV
if: github.event_name == 'schedule'

- name: "perform sync operations"
if: steps.diffcheck.outputs.stdout != '0'
run: |
Expand Down

0 comments on commit b9a7f07

Please sign in to comment.