Publish Storage-Squid Docker image #14
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 Storage-Squid Docker image | |
on: | |
workflow_dispatch: | |
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 Version | |
id: extract_version | |
shell: bash | |
run: | | |
echo "squid_version=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT | |
- name: Make some space | |
shell: bash | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- 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 storage-squid | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile | |
push: false | |
load: true | |
tags: joystream/storage-squid:latest | |
- name: Push storage-squid | |
run: | | |
docker image tag joystream/storage-squid:latest joystream/storage-squid:${{ steps.extract_version.outputs.squid_version }} | |
docker push joystream/storage-squid:${{ steps.extract_version.outputs.squid_version }} | |
- name: Push storage-squid latest tag | |
if: github.ref == 'refs/heads/main' | |
run: | | |
docker push joystream/storage-squid:latest |