Merge pull request #110 from ineiti/template_storage #197
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: Docker Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: jetli/wasm-pack-action@v0.3.0 | |
with: | |
version: 'latest' | |
- uses: jetli/trunk-action@v0.5.0 | |
with: | |
version: 'v0.20.3' | |
- name: Add wasm target | |
run: rustup target add wasm32-unknown-unknown | |
- name: Set up cargo cache | |
uses: actions/cache@v4 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
**/target/ | |
key: cargo-docker-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-docker | |
cargo-build | |
cargo | |
- name: Update build tag | |
run: make update_version | |
- name: Build signal server | |
run: cd cli && cargo build --release -p flsignal | |
- name: Build flnode for docker server | |
run: cd cli && cargo build --release -p fledger | |
- name: Build web server | |
run: cd flbrowser && trunk build | |
- name: Docker build signal | |
uses: mr-smithers-excellent/docker-build-push@v5 | |
with: | |
image: fledgre/flsignal | |
registry: docker.io | |
dockerfile: Dockerfile.flsignal | |
directory: cli/target/release | |
username: ${{ secrets.DOCKERHUB_NAME }} | |
password: ${{ secrets.DOCKERHUB }} | |
tags: latest | |
- name: Docker build fledger | |
uses: mr-smithers-excellent/docker-build-push@v5 | |
with: | |
image: fledgre/fledger | |
registry: docker.io | |
dockerfile: Dockerfile.fledger | |
directory: cli/target/release | |
username: ${{ secrets.DOCKERHUB_NAME }} | |
password: ${{ secrets.DOCKERHUB }} | |
tags: latest | |
- name: Docker build web | |
uses: mr-smithers-excellent/docker-build-push@v5 | |
with: | |
image: fledgre/web | |
registry: docker.io | |
dockerfile: Dockerfile.web | |
username: ${{ secrets.DOCKERHUB_NAME }} | |
password: ${{ secrets.DOCKERHUB }} | |
tags: latest | |
publish_crate: | |
runs-on: ubuntu-latest | |
needs: docker | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Publish new crates, if any | |
run: make publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: docker | |
steps: | |
- name: Update signal.fledg.re | |
uses: appleboy/ssh-action@master | |
with: | |
host: signal.fledg.re | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
docker-compose pull -q | |
docker-compose down | |
docker-compose up -d |