Skip to content

Commit

Permalink
Create docker-publish.yml
Browse files Browse the repository at this point in the history
fix #43
  • Loading branch information
aesedepece committed Oct 14, 2022
1 parent d92191e commit c0fa797
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 43 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Docker image

on:
release:
types: [published]
workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ github.repository }}

- name: Copy Dockerfile to the root of the repository
shell: bash
run: cp ./docker/Dockerfile .

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
6 changes: 1 addition & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM node:14-alpine3.12

# Read the GitHub API token and release version from --build-arg
ARG GITHUB_API_TOKEN
ARG VERSION

# Install dependencies not included in the base image
RUN apk update
RUN apk upgrade
Expand All @@ -27,6 +23,6 @@ RUN chmod +x dist/bin/*
RUN yarn link

# Set the entrypoint and main command
# Runs the bot by default, but CMD can be overriden when running a container so it runs the reactions monitor server
# Runs the default Infura gateway, but CMD can be overriden when running a container so it runs the reactions monitor server
ENTRYPOINT ["npx"]
CMD ["w3gw-infura"]
38 changes: 0 additions & 38 deletions docker/downloader.sh

This file was deleted.

0 comments on commit c0fa797

Please sign in to comment.