Skip to content

Commit

Permalink
automate image build and upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dufkan committed Aug 8, 2024
1 parent d25b1b3 commit a342f5d
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Docker Image CI
name: Upload btc-node

on:
push:
branches:
- main
paths:
- 'containers/**'
- 'containers/btc-node/**'

jobs:
docker:
Expand All @@ -14,13 +16,11 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./containers/wasabi-clients/2.0.4/
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
context: "{{ defaultContext }}:containers/btc-node"
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/wasabi-client:latest
tags: ${{ secrets.DOCKERHUB_USERNAME }}/btc-node:latest
26 changes: 26 additions & 0 deletions .github/workflows/wasabi-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Upload wasabi-backend

on:
push:
branches:
- main
paths:
- 'containers/wasabi-backend/**'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{ defaultContext }}:containers/wasabi-backend"
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/wasabi-backend:latest
45 changes: 45 additions & 0 deletions .github/workflows/wasabi-clients.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Upload wasabi-clients

on:
push:
branches:
- main
paths:
- 'containers/wasabi-clients/**'

jobs:
list-wasabi-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: List Wasabi versions
id: list-versions
run: |
cd containers/wasabi-clients
VERSIONS=$(ls -d */ | cut -f1 -d'/' | sort -V | jq -R . | jq -s . | tr -d '\n ')
echo "versions=$VERSIONS" >> "$GITHUB_OUTPUT"
outputs:
versions: ${{ steps.list-versions.outputs.versions }}

docker:
needs: list-wasabi-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.list-wasabi-versions.outputs.versions) }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{ defaultContext }}:containers/wasabi-clients/${{ matrix.version }}"
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/wasabi-client:${{ matrix.version }}

0 comments on commit a342f5d

Please sign in to comment.