-
Notifications
You must be signed in to change notification settings - Fork 13
82 lines (69 loc) · 2.89 KB
/
docker-ci-test.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: docker-ci-test
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
- "develop"
jobs:
deploy-test:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Artifact Registry/GCR
uses: docker/login-action@v2
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
- uses: actions/checkout@v2
# - uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
- name: Build & Publish the Docker image
run: |
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --platform=linux/amd64 . -t us-docker.pkg.dev/covalent-project/network/refiner:latest --push
# docker buildx create --name builder --use --platform=linux/amd64,linux/arm64 && docker buildx build --platform=linux/amd64,linux/arm64 . -t us-docker.pkg.dev/covalent-project/network/refiner:latest --push
- name: Create .env file
run: |
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
touch .env
{
echo "WEB3_JWT=${{ secrets.WEB3_JWT }}"
echo "IPFS_PINNER_URL=${{ secrets.IPFS_PINNER_URL }}"
echo "ERIGON_NODE=${{ secrets.ERIGON_NODE }}"
echo "NODE_ETHEREUM_MAINNET=${{ secrets.NODE_ETHEREUM_MAINNET }}"
echo "BLOCK_RESULT_OPERATOR_PRIVATE_KEY=${{ secrets.BLOCK_RESULT_OPERATOR_PRIVATE_KEY }}"
echo "EVM_SERVER_URL=${{ secrets.EVM_SERVER_URL }}"
echo "CI=${{ secrets.CI }}"
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}"
echo "GITHUB_REF=${{ github.ref_name }}"
echo "CODECOV_SLUG=covalenthq/refiner"
echo "GITHUB_SHA=$GITHUB_SHA"
echo "GITHUB_HEAD_REF=$GITHUB_HEAD_REF"
echo "GITHUB_ENV=$GITHUB_ENV"
echo "W3_AGENT_KEY=${{ secrets.W3_AGENT_KEY }}"
echo "PROOF_OUT_HEX=${{ secrets.PROOF_OUT_HEX }}"
echo "W3_DELEGATION_FILE=${{ secrets.W3_DELEGATION_FILE }}"
} >> .env
cat .env
- name: Load .env file
uses: xom9ikk/[email protected]
- name: Run containers
run: docker compose --env-file ".env" -f "docker-compose-ci.yml" up --remove-orphans --exit-code-from refiner
- name: Check running refiner
run: docker inspect refiner
- name: Check running containers
run: docker ps
- name: Delete .env & bin files
run: |
rm -rf .env
- name: Stop containers
if: always()
run: docker compose -f "docker-compose-ci.yml" down