Skip to content

Commit

Permalink
separate docker image publish from release workflow (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
v9n authored Aug 3, 2023
1 parent 1f62244 commit 8658161
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 26 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Docker

on:
workflow_dispatch:
inputs:
tag:
description: Tag for release
required: true

jobs:
build-docker:
name: Build and Publis to Docker Hub
runs-on: ubuntu-latest
needs: build-binary
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tag }}
- name: Download binary
uses: actions/download-artifact@v2
with:
name: oak-collator
- name: Build
run: |
tag=${{ github.event.inputs.tag }}
docker_tag="${tag:1}"
docker build -f ./docker/turing/Dockerfile -t oaknetwork/turing:$docker_tag .
docker tag oaknetwork/turing:$docker_tag oaknetwork/turing:latest
docker push oaknetwork/turing:$docker_tag
docker push oaknetwork/turing:latest
28 changes: 2 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
with:
name: oak-collator
path: artifacts/

build-runtime:
name: Build Runtime
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,32 +63,7 @@ jobs:
path: |
${{ matrix.chain }}-runtime.wasm
${{ matrix.chain }}-srtool-digest.json
build-docker:
name: Build Docker
runs-on: ubuntu-latest
needs: build-binary
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tag }}
- name: Download binary
uses: actions/download-artifact@v2
with:
name: oak-collator
- name: Build
run: |
tag=${{ github.event.inputs.tag }}
docker_tag="${tag:1}"
docker build -f ./docker/turing/Dockerfile -t oaknetwork/turing:$docker_tag .
docker tag oaknetwork/turing:$docker_tag oaknetwork/turing:latest
docker push oaknetwork/turing:$docker_tag
docker push oaknetwork/turing:latest
release:
name: Release
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8658161

Please sign in to comment.