forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating the docker deployment github actions yml
Adding the dockercompose file
- Loading branch information
Showing
2 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
name: Build & Push Docker image for project | ||
name: Docker Image Build and Push to ghcr | ||
|
||
on: | ||
push: | ||
types: [labeled] | ||
pull_request: | ||
types: [labeled] | ||
branches: [ "main" ] | ||
types: [ labeled ] | ||
|
||
jobs: | ||
# Adding this so that I can test my jobs and run workflows manually from the Actions tab in the repository | ||
workflow_dispatch: | ||
|
||
build-and-push: | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: san-est/go-ethereum-devops | ||
|
||
jobs: | ||
build-and-push: | ||
if: ${{ github.event.label.name == 'CI:Build' }} | ||
runs-on: ubuntu-latest | ||
if: ${{ (github.event_name == 'pull_request' && github.event.label.name == 'CI:Build') }} | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to Github Container repository | ||
- uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag go-etherium-devops:$(date +%s) | ||
- name: Push Docker image to Github container repository | ||
run: docker push ghcr.io/go-etherium-devops:$(date +%s) | ||
|
||
- name: Login to registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.8' | ||
|
||
services: | ||
geth: | ||
image: san-est/go-ethereum-devops:latest | ||
#ports were grabbed from the docker quick start in the README within https://github.com/ethereum/go-ethereum | ||
ports: | ||
- "8545:8545" | ||
- "30303:30303" | ||
volumes: | ||
- ./data:/root/.ethereum | ||
#running the node in dev mode, enabling RPC server, binding it to all availible networks, sets on which port RPC should listen to and availible APIs. | ||
command: ["--dev", "--http", "--http.addr", "0.0.0.0", "--http.port", "8545", "--http.api", "eth,net,web3"] |