Docker compose tweaks #66
Workflow file for this run
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
name: Publish Colossus/Argus/QueryNode Docker images | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build_and_publish: | |
name: Build and Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Extract Package Versions | |
id: extract_versions | |
shell: bash | |
run: | | |
echo "colossus_version=$(cat storage-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT | |
echo "argus_version=$(cat distributor-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT | |
echo "qn_version=$(cat query-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
if: github.event_name == 'workflow_dispatch' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build joystream-node | |
run: RUNTIME_PROFILE=TESTING ./build-node-docker.sh | |
# docker/build-push-action doc: | |
# Be careful because any file mutation in the steps that precede the | |
# build step will be ignored, including processing of the .dockerignore file | |
# since the context is based on the Git reference. However, you can use | |
# the Path context using the context input alongside the actions/checkout action | |
# to remove this restriction. | |
- name: Build storage-node | |
uses: docker/build-push-action@v3 | |
with: | |
# Do not use local dir context to ensure we can build from a commit directly | |
# context: . | |
file: colossus.Dockerfile | |
push: false | |
load: true | |
tags: joystream/storage-node:latest | |
- name: Build distributor-node | |
uses: docker/build-push-action@v3 | |
with: | |
# Do not use local dir context to ensure we can build from a commit directly | |
# context: . | |
file: distributor-node.Dockerfile | |
push: false | |
load: true | |
tags: joystream/distributor-node:latest | |
- name: Build query-node | |
uses: docker/build-push-action@v3 | |
with: | |
# Do not use local dir context to ensure we can build from a commit directly | |
# context: . | |
file: query-node.Dockerfile | |
push: false | |
load: true | |
tags: joystream/query-node:latest | |
- name: Test with latest images | |
run: | | |
yarn build:packages | |
cp docker-compose-no-bind-volumes.yml docker-compose.yml | |
./tests/network-tests/run-tests.sh content-directory | |
- name: Push new versions | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
docker image tag joystream/storage-node:latest joystream/storage-node:${{ steps.extract_versions.outputs.colossus_version }} | |
docker image tag joystream/distributor-node:latest joystream/distributor-node:${{ steps.extract_versions.outputs.argus_version }} | |
docker image tag joystream/query-node:latest joystream/query-node:${{ steps.extract_versions.outputs.qn_version }} | |
docker push joystream/storage-node:${{ steps.extract_versions.outputs.colossus_version }} | |
docker push joystream/distributor-node:${{ steps.extract_versions.outputs.argus_version }} | |
docker push joystream/query-node:${{ steps.extract_versions.outputs.qn_version }} | |
- name: Push latest tag | |
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' | |
run: | | |
docker push joystream/storage-node:latest | |
docker push joystream/distributor-node:latest | |
docker push joystream/query-node:latest | |