This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
Merge pull request #655 from NeilInnes/view_only_user #1
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: Test, Build & Deploy | |
on: | |
push: | |
branches: [ 'master' ] | |
pull_request: | |
branches: [ 'master' ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
clojure: | |
name: Test & Build Clojure | |
env: | |
DOCKER: stable | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: install java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- name: install clojure tools | |
uses: DeLaGuardo/[email protected] | |
with: | |
lein: latest | |
- run: ./init-db.sh | |
name: start DB | |
working-directory: dev/script | |
- run: ./init-influx.sh | |
name: start Influx | |
working-directory: dev/script | |
- run: ./init-influx.sh | |
name: start Agent | |
working-directory: dev/script | |
- run: ./start-dind.sh | |
name: start Docker in Docker | |
working-directory: dev/script | |
- run: lein deps | |
- run: lein test :all | |
- run: lein uberjar | |
- name: upload release jar | |
uses: actions/upload-artifact@v3 | |
with: | |
name: swarmpit.jar | |
path: target/swarmpit.jar | |
docker: | |
name: Build and push docker | |
runs-on: ubuntu-latest | |
needs: clojure | |
env: | |
SECRET: ${{ secrets.PKG_USER }} | |
PR: ${{ github.event.pull_request.number }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
name: download release jar | |
with: | |
name: swarmpit.jar | |
path: target | |
- name: set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: login to GHCR | |
if: env.SECRET != 0 | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.PKG_USER }} | |
password: ${{ secrets.PKG_PWD }} | |
- name: login to DockerHub | |
if: env.SECRET != 0 | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_PASS }} | |
- name: build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: ${{ env.SECRET != 0 }} | |
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v5 | |
tags: swarmpit/swarmpit:latest |