-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build container on release (#396)
* new (CI): optimized Dockerfile; labeled Dockerfile; Github Action to build container; edit docker-compose * new (CI): rename secrets * CI: edit registry name * CI: edit registry namespace * CI: do repeat yourself in GHA * CI: fix maintainers; debug version tag * CI: add rpc to env file * CI: build the same image in parallel, what a joke * CI: fix matrix * CI: debug matrix * CI: debug matrix 2 * CI: according to doc this should work * CI: proudly move it to parity namespace * CI: add docker pull to README
- Loading branch information
1 parent
43a8137
commit ed52edd
Showing
5 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and Publish container for new releases | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
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 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tag: ${{ matrix.tag }} | ||
dockerfiles: | | ||
./Dockerfile | ||
build-args: | | ||
VERSION=${{ env.VERSION }} | ||
VCS_REF=${{ github.ref }} | ||
BUILD_DATE=${{ github.event.release.published_at }} | ||
- name: Push image tagged ${{ matrix.tag }} to docker.io | ||
id: push-to-dockerhub | ||
uses: redhat-actions/push-to-registry@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
image: ${{ env.IMAGE_NAME }} | ||
tag: ${{ matrix.tag }} | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Check the image | ||
run: | | ||
echo "New image has been pushed to ${{ steps.push-to-dockerhub.outputs.registry-path }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters