Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: optimize buildah build x2 #452

Merged
merged 3 commits into from
Mar 9, 2021
Merged
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
33 changes: 11 additions & 22 deletions .github/workflows/publish-release-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,29 @@ jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
strategy:
matrix:
# this matrix runs the jobs twice, in parallel. This is due to
# both buildah actions can't manage more than one image tag.
tag:
- latest
- ${{ github.event.release.tag_name }}
env:
REGISTRY: docker.io/parity
IMAGE_NAME: substrate-api-sidecar
VERSION: ${{ github.event.release.tag_name }}

steps:

- uses: actions/checkout@v2

- name: Build Image tagged ${{ matrix.tag }}
uses: redhat-actions/buildah-build@v1
- name: Build Image
uses: redhat-actions/buildah-build@v2.2
with:
image: ${{ env.IMAGE_NAME }}
tag: ${{ matrix.tag }}
image: substrate-api-sidecar
tags: ${{ github.event.release.tag_name }}, latest
dockerfiles: |
./Dockerfile
build-args: |
VERSION=${{ env.VERSION }}
VERSION=${{ github.event.release.tag_name }}
VCS_REF=${{ github.ref }}
BUILD_DATE=${{ github.event.release.published_at }}

- name: Push image tagged ${{ matrix.tag }} to docker.io
- name: Push image to docker.io
id: push-to-dockerhub
uses: redhat-actions/push-to-registry@v1
uses: redhat-actions/push-to-registry@v2.1.1
with:
registry: ${{ env.REGISTRY }}
image: ${{ env.IMAGE_NAME }}
tag: ${{ matrix.tag }}
registry: docker.io/parity
image: substrate-api-sidecar
tags: ${{ github.event.release.tag_name }}, latest
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

Expand Down