|
1 | 1 | name: test |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request_target: |
| 4 | + pull_request: |
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - main |
|
12 | 12 | steps: |
13 | 13 | - uses: actions/checkout@v4 |
14 | 14 | - uses: chartboost/ruff-action@v1 |
15 | | - build: |
| 15 | + build-image: |
16 | 16 | needs: [ruff] |
17 | 17 | runs-on: ubuntu-latest |
18 | 18 | steps: |
|
38 | 38 | name: warnet |
39 | 39 | path: /tmp/warnet.tar |
40 | 40 | test: |
41 | | - needs: [build] |
| 41 | + needs: [build-image] |
42 | 42 | runs-on: ubuntu-latest |
43 | 43 | strategy: |
44 | 44 | matrix: |
|
56 | 56 | - name: Run tests |
57 | 57 | run: ./test/${{matrix.test}} ${{matrix.backend}} |
58 | 58 | build-test: |
59 | | - needs: [build, test] |
| 59 | + needs: [build-image] |
60 | 60 | runs-on: ubuntu-latest |
61 | 61 | steps: |
62 | 62 | - uses: actions/checkout@v4 |
63 | 63 | - uses: ./.github/actions/compose |
64 | 64 | - run: ./test/build_branch_test.py compose |
65 | | - deploy: |
66 | | - needs: [build-test] |
67 | | - runs-on: ubuntu-latest |
68 | | - steps: |
69 | | - - uses: actions/checkout@v4 |
70 | | - - name: Set up QEMU |
71 | | - uses: docker/setup-qemu-action@v3 |
72 | | - - name: Set up Docker Buildx |
73 | | - uses: docker/setup-buildx-action@v3 |
74 | | - - name: Docker meta |
75 | | - id: meta |
76 | | - uses: docker/metadata-action@v5 |
77 | | - with: |
78 | | - images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_RPC_REPO }} |
79 | | - tags: | |
80 | | - type=ref,event=tag |
81 | | - type=ref,event=pr |
82 | | - type=raw,value=latest,enable={{is_default_branch}} |
83 | | - labels: | |
84 | | - maintainer=bitcoindevproject |
85 | | - org.opencontainers.image.title=warnet-rpc |
86 | | - org.opencontainers.image.description=Warnet RPC server |
87 | | - - name: Login to Docker Hub |
88 | | - uses: docker/login-action@v3 |
89 | | - with: |
90 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
91 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
92 | | - - name: Build and push production RPC image |
93 | | - uses: docker/build-push-action@v5 |
94 | | - with: |
95 | | - file: src/templates/rpc/Dockerfile_rpc |
96 | | - platforms: linux/amd64,linux/arm64 |
97 | | - context: . |
98 | | - push: true |
99 | | - tags: ${{ steps.meta.outputs.tags }} |
100 | | - labels: ${{ steps.meta.outputs.labels }} |
101 | | - cache-from: type=gha |
102 | | - cache-to: type=gha,mode=max |
103 | | - - name: Build and push dev RPC image |
104 | | - if: github.ref == 'refs/heads/main' |
105 | | - uses: docker/build-push-action@v5 |
106 | | - with: |
107 | | - file: src/templates/rpc/Dockerfile_rpc_dev |
108 | | - platforms: linux/amd64,linux/arm64 |
109 | | - context: . |
110 | | - push: true |
111 | | - tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_RPC_REPO }}:dev |
112 | | - labels: ${{ steps.meta.outputs.labels }} |
113 | | - cache-from: type=gha |
114 | | - cache-to: type=gha,mode=max |
0 commit comments