Skip to content

Commit

Permalink
Merge pull request #4 from ArweaveTeam/ready-to-use-docker
Browse files Browse the repository at this point in the history
Github action to build and publish gateway image every release. Use that image in docker-compose.
  • Loading branch information
luca-arweave authored Mar 10, 2021
2 parents 294421e + 1f86257 commit 143bf79
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/gateway-image-build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build Release

on:
release:
types: [created]

jobs:
build_gateway_image:
name: Build gateway image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/gateway.dockerfile
push: true
tags: |
ghcr.io/demo-hub/testweave-gateway:latest
ghcr.io/demo-hub/testweave-gateway:${{ github.event.release.tag_name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ services:
- "ardata:/mnt/arweave-data"
# Arweave Gateway configuration
gateway:
build:
context: .
dockerfile: ./docker/gateway.dockerfile
image: ghcr.io/demo-hub/testweave-gateway:latest
volumes:
- app:/app
expose:
Expand Down

0 comments on commit 143bf79

Please sign in to comment.