Skip to content

Commit

Permalink
ci: Automatically rebuild development/CI Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Jun 2, 2020
1 parent 83e9a9b commit 8a334c1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: docker

# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- master
- stable/*
paths:
- docker/**
# XXX: Remove section below, this is only for testing.
pull_request:
branches:
- master
- stable/*
paths:
- docker/**

jobs:

build-images:
# NOTE: This name appears in GitHub's Checks API.
name: build-images
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Determine tag name
id: determine_tag
shell: bash
run: |
branch=${GITHUB_REF#refs/heads/}
branch=${branch/\//-}
echo "##[set-output name=tag;]$(echo ${branch})"
- name: "Rebuild oasisprotocol/oasis-core-dev:${{ steps.determine_tag.outputs.tag }}"
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
repository: oasisprotocol/oasis-core-dev
tags: ${{ steps.determine_tag.outputs.tag }}
add_git_labels: true
path: docker/development
always_pull: true
- name: "Rebuild oasisprotocol/oasis-core-ci:${{ steps.determine_tag.outputs.tag }}"
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
repository: oasisprotocol/oasis-core-ci
tags: ${{ steps.determine_tag.outputs.tag }}
add_git_labels: true
path: docker/testing
build_args: OASIS_CORE_DEV_BASE_TAG=${{ steps.determine_tag.outputs.tag }}
always_pull: true
4 changes: 3 additions & 1 deletion docker/testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM oasislabs/development:0.3.0
ARG OASIS_CORE_DEV_BASE_TAG=master

FROM oasisprotocol/oasis-core-dev:${OASIS_CORE_DEV_BASE_TAG}

RUN apt-get install -y \
unzip jq \
Expand Down

0 comments on commit 8a334c1

Please sign in to comment.