diff --git a/.github/workflows/publish-docker-image-staging-on-demand.yml b/.github/workflows/publish-docker-image-staging-on-demand.yml index 3dc4250aee30..459425b55a39 100644 --- a/.github/workflows/publish-docker-image-staging-on-demand.yml +++ b/.github/workflows/publish-docker-image-staging-on-demand.yml @@ -1,3 +1,4 @@ + name: Publish Docker image to staging on demand on: @@ -9,6 +10,7 @@ on: - 'CHANGELOG.md' - '**/README.md' - 'docker-compose/*' + env: OTP_VERSION: ${{ vars.OTP_VERSION }} ELIXIR_VERSION: ${{ vars.ELIXIR_VERSION }} @@ -22,16 +24,26 @@ jobs: push_to_registry: name: Push Docker image to GitHub Container Registry runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v5 - - name: Setup repo - uses: ./.github/actions/setup-repo - id: setup + - name: Check out repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - docker-remote-multi-platform: true - docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }} - docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=${GITHUB_SHA::8}" >> $GITHUB_ENV - name: Build and push Docker image uses: docker/build-push-action@v6 @@ -39,9 +51,9 @@ jobs: context: . file: ./docker/Dockerfile push: true - cache-from: type=registry,ref=ghcr.io/blockscout/blockscout:buildcache - cache-to: type=registry,ref=ghcr.io/blockscout/blockscout:buildcache,mode=max - tags: ghcr.io/blockscout/blockscout-staging:latest, ghcr.io/blockscout/blockscout-staging:${{ env.RELEASE_VERSION }}.commit.${{ env.SHORT_SHA }} + cache-from: type=registry,ref=ghcr.io/lambdaclass/blockscout-private:buildcache + cache-to: type=registry,ref=ghcr.io/lambdaclass/blockscout-private:buildcache,mode=max + tags: ghcr.io/lambdaclass/blockscout-private:master, ghcr.io/lambdaclass/blockscout-private:${{ env.RELEASE_VERSION }}.commit.${{ env.SHORT_SHA }} labels: ${{ steps.setup.outputs.docker-labels }} platforms: | linux/amd64 @@ -54,3 +66,4 @@ jobs: AMPLITUDE_API_KEY= BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}.+commit.${{ env.SHORT_SHA }} RELEASE_VERSION=${{ env.RELEASE_VERSION }} +