Skip to content

Add github ci

Add github ci #4

Workflow file for this run

name: build image
on:
pull_request:
push:
branches:
- master
env:
IMAGE_NAME: paritytech/polkadot-hub-app
jobs:
build_and_push:
name: Build Docker image and push it to Docker Hub
runs-on: ubuntu-latest
environment: master_and_tags
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build and push Docker image from master
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.ref == 'refs/heads/master' }}
build-args:
tags: |
${{ env.IMAGE_NAME }}:master
${{ env.IMAGE_NAME }}:latest