Skip to content

Commit

Permalink
Publish nightly version to Docker Hub too (#2667)
Browse files Browse the repository at this point in the history
* Publish nightly version to Docker Hub too

* Get package json version

* Follow nightly image in docker-compose

* Tag main image as latest

* Force to install exact nightly

* Force to install exact released version

* Don't build image in tests workflow
  • Loading branch information
dapplion authored Jun 10, 2021
1 parent 8c5003f commit 30f03de
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release nightly

# only one per github sha can be run
concurrency:
concurrency:
group: ${{ github.sha }}
cancel-in-progress: true

Expand All @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: "14.16.0"
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
- name: Restore dependencies
uses: actions/cache@master
id: cache-deps
Expand All @@ -40,3 +40,25 @@ jobs:
run: yarn run publish:nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get version
id: version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
outputs:
version: ${{ steps.version.outputs.version }}

docker:
name: Publish to Docker Hub
runs-on: ubuntu-latest
needs: publish
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: docker build --tag chainsafe/lodestar:next --build-arg VERSION=${{ needs.publish.outputs.version }} .
- run: docker tag chainsafe/lodestar:next chainsafe/lodestar:${{ needs.publish.outputs.version }}
# Push all tags
- run: docker push chainsafe/lodestar
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ jobs:
delete_orphan_tag: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
name: Build docker image
name: Publish to Docker Hub
runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.tag != ''
Expand All @@ -120,5 +121,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: docker build --tag chainsafe/lodestar:${{ needs.tag.outputs.tag }} .
- run: docker push chainsafe/lodestar:${{ needs.tag.outputs.tag }}
- run: docker build --tag chainsafe/lodestar:latest --build-arg VERSION=${{ needs.tag.outputs.tag }} .
- run: docker tag chainsafe/lodestar:latest chainsafe/lodestar:${{ needs.tag.outputs.tag }}
# Push all tags
- run: docker push chainsafe/lodestar
15 changes: 0 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,3 @@ jobs:
run: yarn coverage
- name: E2e tests
run: yarn test:e2e

docker:
name: Build docker image
runs-on: ubuntu-latest
needs: [tests-main]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: docker build --tag chainsafe/lodestar:latest .
- run: docker push chainsafe/lodestar:latest
3 changes: 1 addition & 2 deletions docker-compose.validator.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: "3.4"
services:
validator:
build: .
image: lodestar
image: chainsafe/lodestar@next
restart: always
volumes:
- validator:/data
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: "3.4"
services:
beacon_node:
build: .
image: lodestar
image: chainsafe/lodestar@next
restart: always
volumes:
- beacon_node:/data
Expand Down

1 comment on commit 30f03de

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 30f03de Previous: 647acb0 Ratio
processRegistryUpdates 41409.58217731583 ops/sec (±0.00%) 106541.65778819518 ops/sec (±0.00%) 2.57
processSlashings 82.30796132809822 ops/sec (±0.00%) 232.75798662479505 ops/sec (±0.00%) 2.83

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.