diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000000..2778074a1d --- /dev/null +++ b/.github/workflows/build.yaml @@ -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} diff --git a/.github/workflows/sync-and-build-plugins.yaml b/.github/workflows/sync-and-build-plugins.yaml index d830b54a29..551e74fd09 100644 --- a/.github/workflows/sync-and-build-plugins.yaml +++ b/.github/workflows/sync-and-build-plugins.yaml @@ -1,12 +1,8 @@ name: sync on: - push: - branches: - - "pgeth" schedule: - cron: "0 * * * *" # every hour - workflow_dispatch: permissions: write-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: |