-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (49 loc) · 1.67 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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