Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image public repo implementation #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Create Image Tarball
- name: Build and Push Docker Image
run: |
docker build --build-arg GIT_COMMIT_SHA=$(git rev-parse --short HEAD) --build-arg GIT_TAG=$(git describe --tags --abbrev=0) -t explorer-frontend .
docker save -o explorer-frontend.tar explorer-frontend
mkdir -p artifacts
mv explorer-frontend.tar artifacts/
DATE=$(date +%d%m%y)
HMS=$(date +%H%M%S)
echo "DATE: $DATE, HMS: $HMS"
docker build -t docker.io/atletanetwork/blockscout:frontend-${DATE}-${HMS} .
docker tag docker.io/atletanetwork/blockscout:frontend-${DATE}-${HMS} docker.io/atletanetwork/blockscout:frontend-latest
docker push docker.io/atletanetwork/blockscout:frontend-${DATE}-${HMS}
docker push docker.io/atletanetwork/blockscout:frontend-latest

- name: Set up SSH
run: |
Expand All @@ -31,7 +34,6 @@ jobs:

- name: Copy Files to Server
run: |
scp -r artifacts/* ${{ secrets.HOST_USER}}@${{ secrets.EXPLORER_HOST }}:/blockscout/
scp -r deploy/* ${{ secrets.HOST_USER}}@${{ secrets.EXPLORER_HOST }}:/blockscout/


Expand All @@ -43,7 +45,6 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /blockscout
docker load -i explorer-frontend.tar
docker compose down
docker compose pull
docker compose up -d --build --remove-orphans
2 changes: 1 addition & 1 deletion deploy/services/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.9'

services:
frontend:
image: explorer-frontend
image: atletanetwork/blockscout:frontend-latest
pull_policy: never
restart: always
container_name: 'frontend'
Expand Down
Loading