Merge pull request #835 from zeus-fyi/staging #13
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: Build Flows Backend App | |
on: | |
push: | |
paths: | |
- apps/olympus/zeus/** | |
- pkg/aegis/auth_startup/** | |
- pkg/aegis/sessions/** | |
- pkg/zeus/** | |
- pkg/hestia/** | |
- datastores/postgres/apps/zeus/** | |
- datastores/postgres/apps/hera/models/** | |
- datastores/s3/** | |
- docker/zeus/Dockerfile | |
- .github/workflows/zeus.yml | |
branches: | |
- main | |
- csv-merge | |
# Configure a trust relationship on your Depot project for your git repository so you can use OIDC token auth between GHA and your Depot project. | |
permissions: | |
contents: read | |
id-token: write | |
env: | |
REPO: registry.digitalocean.com/zeus-fyi | |
NAME: flows-backend | |
TAG: latest | |
GO111MODULE: on | |
GOOS: linux | |
GOARCH: amd64 | |
CGO_ENABLED: 0 | |
GOCACHE: ~/go-build | |
GOMODCACHE: ~/go/pkg/mod | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Cache Go Modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Depot CLI | |
uses: depot/setup-action@v1 | |
- name: Clone external repos into workspace | |
run: | | |
mkdir -p apps/external | |
cd apps/external | |
git clone https://github.com/zeus-fyi/web3.git --branch master --single-branch | |
git clone https://github.com/zeus-fyi/tables-to-go.git --branch master --single-branch | |
git clone https://github.com/zeus-fyi/jennifer.git --branch master --single-branch | |
git clone https://github.com/zeus-fyi/tojen.git --branch master --single-branch | |
git clone https://github.com/zeus-fyi/memoryfs.git --branch master --single-branch | |
git clone https://github.com/zeus-fyi/flashbotsrpc.git --branch master --single-branch | |
- name: Clone external zeus repo into workspace | |
run: | | |
mkdir -p apps | |
cd apps | |
git clone https://github.com/zeus-fyi/zeus.git --branch main --single-branch | |
- name: Install dependencies | |
run: | | |
wget https://github.com/digitalocean/doctl/releases/download/v1.78.0/doctl-1.78.0-linux-amd64.tar.gz -O doctl.tar.gz | |
tar xf doctl.tar.gz -C /usr/local/bin | |
- name: Build And Publish Flows Backend App | |
run: | | |
sed -i '/\.\/apps\/external\/go-ethereum/d' go.work | |
doctl registry login -t ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
depot build \ | |
-t ${{ env.REPO }}/${{ env.NAME }}:latest \ | |
--build-arg GOMODCACHE=${{ env.GOMODCACHE }} \ | |
--build-arg GOCACHE=${{ env.GOCACHE }} \ | |
--build-arg GOOS=${{ env.GOOS }} \ | |
--build-arg CA_CRT="${{ secrets.CA_CRT }}" \ | |
--build-arg CA_PEM="${{ secrets.DEV_CA_PEM }}" \ | |
--build-arg CA_KEY="${{ secrets.DEV_CA_KEY }}" \ | |
--platform=${{ env.GOOS }}/${{ env.GOARCH }} \ | |
--token ${{ secrets.DEPOT_TOKEN }} \ | |
--provenance=false \ | |
-f docker/zeus/Dockerfile . --push | |