From 569ee1ee4670a7059d0832986957fa8cb1e1e971 Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Wed, 17 Jul 2024 10:24:13 +0200 Subject: [PATCH] feat: add workflow to deploy docker images with github action --- .github/workflows/docker-release.yml | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/docker-release.yml diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 00000000..946be0f6 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,56 @@ +name: Build and publish scroll-alpine image + +on: + push: + tags: + - 'v*.*.*' +jobs: + build: + name: Clone, Build, Publish + runs-on: ubuntu-latest + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Dockerhub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build deploy image + id: build_deploy_image + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: scrolltech/scroll-stack-contracts + uses: docker/build-push-action@v3 + with: + platforms: linux/amd64,linux/arm64 + push: true + context: . + file: docker/Dockerfile/deploy + tags: | + ${{ env.REPOSITORY }}:deploy-${{ env.VERSION }} + ${{ env.REPOSITORY }}:latest + + - name: Build gen image + id: build_gen_image + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: scrolltech/scroll-stack-contracts + uses: docker/build-push-action@v3 + with: + platforms: linux/amd64,linux/arm64 + push: true + context: . + file: docker/Dockerfile/gen-configs + tags: | + ${{ env.REPOSITORY }}:gen-configs-${{ env.VERSION }} + ${{ env.REPOSITORY }}:latest