Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/scripts/docker-build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .github/scripts/docker-release.sh

This file was deleted.

46 changes: 28 additions & 18 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
name: Continous Deployment

on:
workflow_dispatch:
push:
branches:
- master
- "master"
tags:
- v*
env:
# This is a base repository and we use git refs to set the version of the container
# ${GITHUB_REF##*/} will be either a branch name or a tag depending on the event
REPO: blossomlabs/blob-indexer
- "v*"
pull_request:
branches:
- "master"

jobs:
build:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker login -u ${{secrets.DOCKERHUB_USER}} -p ${{secrets.DOCKERHUB_TOKEN}}
- run: .github/scripts/docker-build.sh . $REPO ${GITHUB_SHA}

release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- run: docker login -u ${{secrets.DOCKERHUB_USER}} -p ${{secrets.DOCKERHUB_TOKEN}}
- run: .github/scripts/docker-release.sh $REPO:${GITHUB_SHA} $REPO:${GITHUB_REF##*/}
- run: .github/scripts/docker-release.sh $REPO:${GITHUB_SHA} $REPO:latest
- name: Checkout
uses: actions/checkout@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: blossomlabs/blobscan-indexer
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}