From 3323bdd21ca077930b095a3b9ad50cb7681cf532 Mon Sep 17 00:00:00 2001 From: jesse snyder Date: Tue, 28 Mar 2023 17:15:58 -0600 Subject: [PATCH 1/2] fix gh action syntax (#4) * containerize w/ github action to build and push to ghcr * fix gh action yml syntax * enable manual trigger * fix syntax --- .github/workflows/astria-build-and-publish-image.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/astria-build-and-publish-image.yml b/.github/workflows/astria-build-and-publish-image.yml index 86f4ec936a66..8544520ca30d 100644 --- a/.github/workflows/astria-build-and-publish-image.yml +++ b/.github/workflows/astria-build-and-publish-image.yml @@ -1,19 +1,21 @@ -build-and-publish-latest: +name: Build and Publish Docker image on: + workflow_dispatch: push: branches: - astria # Running this job only for astria branch +jobs: + build-and-publish-latest: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 # Checking out the repo - uses: actions/setup-go@v4 with: - go-version: "^1.20.x" # The Go version to download (if necessary) and use. + go-version: "^1.20.x" # The Go version to download (if necessary) and use. - run: go version - name: Log in to registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin # TODO - build for amd64 and arm64? - name: Build and Publish latest Docker image From be97c9232faae478c6740eefb3f229929ab0417b Mon Sep 17 00:00:00 2001 From: jesse snyder Date: Tue, 28 Mar 2023 17:28:31 -0600 Subject: [PATCH 2/2] build and push manually (#5) * containerize w/ github action to build and push to ghcr * fix gh action yml syntax * enable manual trigger * fix syntax * dont use github action, do it ourselves * push manually --- .../astria-build-and-publish-image.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/astria-build-and-publish-image.yml b/.github/workflows/astria-build-and-publish-image.yml index 8544520ca30d..20e4e3a49592 100644 --- a/.github/workflows/astria-build-and-publish-image.yml +++ b/.github/workflows/astria-build-and-publish-image.yml @@ -18,11 +18,12 @@ jobs: run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin # TODO - build for amd64 and arm64? - - name: Build and Publish latest Docker image - uses: TCPShield/gp-docker-action@1.1.13 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages - image-name: ghcr.io/astriaorg/go-ethereum # Provide only Docker image name, tag will be automatically set to latest - # Pass some additional arguments to the docker build command - # FIXME - version needs to be autoincrement, probably from git tags? - custom-args: --build-arg COMMIT=${GITHUB_SHA} --build-arg VERSION=0.1.0 --build-arg BUILDNUM=${GITHUB_RUN_NUMBER} + # FIXME - version needs to be autoincrement, probably from git tags? + - name: Build latest Docker image + run: docker build \ + --build-arg COMMIT=${GITHUB_SHA} \ + --build-arg VERSION=0.1 \ + --build-arg BUILDNUM=${GITHUB_RUN_NUMBER} \ + --tag ghcr.io/astriaorg/go-ethereum:latest . + - name: Push latest Docker image + run: docker push ghcr.io/astriaorg/go-ethereum:latest