forked from cubedro/eth-netstats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ronin][Netstats]: build docker public on ghcr.io
- Loading branch information
qui-pham
committed
Apr 7, 2023
1 parent
ff6b8d4
commit 8611986
Showing
1 changed file
with
58 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Dockerize | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
|
||
push: | ||
branches: [master] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_REPOSITORY: axieinfinity/ronin-netstat | ||
DOCKER_FILE: Dockerfile | ||
jobs: | ||
push_to_docker_registry: | ||
name: Push Docker image to GHCR.IO | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: 'Checkout Repo With Submodule' | ||
uses: 'actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c' #v3.1.0 | ||
with: | ||
submodules: true | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_REPOSITORY }} | ||
tags: | | ||
type=ref,suffix=-{{sha}},event=branch | ||
type=ref,suffix=-{{sha}},event=pr | ||
type=ref,suffix=-{{sha}},event=tag | ||
type=semver,event=tag,pattern={{raw}} | ||
# Enable Registry Cache | ||
- name: "Set up Docker Buildx" | ||
uses: "docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325" #v2.2.1 | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@37abcedcc1da61a57767b7588cb9d03eb57e28b3 #v3.3.0 | ||
with: | ||
context: . | ||
file: ${{ env.DOCKER_FILE }} | ||
push: true | ||
build-args: | | ||
WS_SECRET=${{ secrets.WS_SECRET }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |