|
4 | 4 | test: |
5 | 5 | runs-on: ubuntu-latest |
6 | 6 | steps: |
7 | | - - uses: actions/setup-go@v3 |
8 | | - with: |
9 | | - go-version: '1.24' |
| 7 | + - uses: actions/setup-go@v3 |
| 8 | + with: |
| 9 | + go-version: "1.24" |
10 | 10 |
|
11 | | - - uses: actions/checkout@v2 |
| 11 | + - uses: actions/checkout@v2 |
12 | 12 |
|
13 | | - # NOTE: using link-local reserved address block in order to avoid conflict. |
14 | | - - name: Add fake IP (169.196.255.254) on loopback interface |
15 | | - run: |- |
16 | | - { ip address | grep -q 169.196.255.254; } || sudo ip address add 169.196.255.254 dev lo |
| 13 | + # NOTE: using link-local reserved address block in order to avoid conflict. |
| 14 | + - name: Add fake IP (169.196.255.254) on loopback interface |
| 15 | + run: |- |
| 16 | + { ip address | grep -q 169.196.255.254; } || sudo ip address add 169.196.255.254 dev lo |
17 | 17 |
|
18 | | - - name: Running required services (Builkit, Docker Registry, Docker) |
19 | | - run: docker compose -f ./compose.yaml up -d |
| 18 | + - name: Running required services (Builkit, Docker Registry, Docker) |
| 19 | + run: docker compose -f ./docker-compose.yaml up -d |
20 | 20 |
|
21 | | - - name: Install protoc and Go compiler plugins |
22 | | - run: |- |
23 | | - sudo apt install -y protobuf-compiler |
24 | | - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 |
25 | | - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 |
| 21 | + - name: Install protoc and Go compiler plugins |
| 22 | + run: |- |
| 23 | + sudo apt install -y protobuf-compiler |
| 24 | + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 |
| 25 | + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 |
26 | 26 |
|
27 | | - - run: make test test/integration |
| 27 | + - run: make test test/integration |
28 | 28 |
|
29 | 29 | lint: |
30 | 30 | runs-on: ubuntu-latest |
31 | 31 | steps: |
32 | | - - uses: actions/setup-go@v3 |
33 | | - with: |
34 | | - go-version: '1.24' |
35 | | - - uses: actions/checkout@v2 |
36 | | - - uses: golangci/golangci-lint-action@v3 |
| 32 | + - uses: actions/setup-go@v3 |
| 33 | + with: |
| 34 | + go-version: "1.24" |
| 35 | + - uses: actions/checkout@v2 |
| 36 | + - uses: golangci/golangci-lint-action@v3 |
37 | 37 |
|
38 | 38 | publish: |
39 | 39 | if: github.repository == 'tsuru/deploy-agent' && github.event_name != 'pull_request' |
40 | 40 | needs: |
41 | | - - lint |
42 | | - - test |
| 41 | + - lint |
| 42 | + - test |
43 | 43 | runs-on: ubuntu-latest |
44 | 44 | steps: |
45 | | - - name: Checkout |
46 | | - uses: actions/checkout@v4 |
47 | | - - name: Set up QEMU |
48 | | - uses: docker/setup-qemu-action@v3 |
49 | | - - name: Set up Docker Buildx |
50 | | - uses: docker/setup-buildx-action@v3 |
51 | | - - uses: Surgo/docker-smart-tag-action@v1 |
52 | | - id: smarttag |
53 | | - with: |
54 | | - docker_image: tsuru/deploy-agent |
55 | | - default_branch: main |
56 | | - tag_with_sha: 'true' |
57 | | - - name: Handle smart-tag to proper tag var |
58 | | - uses: actions/github-script@v6 |
59 | | - id: handle_tag |
60 | | - with: |
61 | | - script: | |
62 | | - var tag_re = /deploy-agent:([0-9])/g |
63 | | - var orig_tags = `${{steps.smarttag.outputs.tag}}` |
64 | | - return orig_tags.replace(tag_re,"deploy-agent:v$1") |
65 | | - - name: docker login |
66 | | - uses: docker/login-action@v3 |
67 | | - with: |
68 | | - username: ${{ secrets.REGISTRY_USERNAME }} |
69 | | - password: ${{ secrets.REGISTRY_PASSWORD }} |
70 | | - - name: push image tag to Docker Hub (tsuru/deploy-agent) |
71 | | - uses: docker/build-push-action@v5 |
72 | | - with: |
73 | | - context: . |
74 | | - push: true |
75 | | - tags: ${{ steps.handle_tag.outputs.result }} |
76 | | - platforms: linux/amd64,linux/arm64 |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v4 |
| 47 | + - name: Set up QEMU |
| 48 | + uses: docker/setup-qemu-action@v3 |
| 49 | + - name: Set up Docker Buildx |
| 50 | + uses: docker/setup-buildx-action@v3 |
| 51 | + - uses: Surgo/docker-smart-tag-action@v1 |
| 52 | + id: smarttag |
| 53 | + with: |
| 54 | + docker_image: tsuru/deploy-agent |
| 55 | + default_branch: main |
| 56 | + tag_with_sha: "true" |
| 57 | + - name: Handle smart-tag to proper tag var |
| 58 | + uses: actions/github-script@v6 |
| 59 | + id: handle_tag |
| 60 | + with: |
| 61 | + script: | |
| 62 | + var tag_re = /deploy-agent:([0-9])/g |
| 63 | + var orig_tags = `${{steps.smarttag.outputs.tag}}` |
| 64 | + return orig_tags.replace(tag_re,"deploy-agent:v$1") |
| 65 | + - name: docker login |
| 66 | + uses: docker/login-action@v3 |
| 67 | + with: |
| 68 | + username: ${{ secrets.REGISTRY_USERNAME }} |
| 69 | + password: ${{ secrets.REGISTRY_PASSWORD }} |
| 70 | + - name: push image tag to Docker Hub (tsuru/deploy-agent) |
| 71 | + uses: docker/build-push-action@v5 |
| 72 | + with: |
| 73 | + context: . |
| 74 | + push: true |
| 75 | + tags: ${{ steps.handle_tag.outputs.result }} |
| 76 | + platforms: linux/amd64,linux/arm64 |
77 | 77 |
|
78 | 78 | release: |
79 | 79 | if: github.event_name != 'pull_request' && github.repository == 'tsuru/deploy-agent' && startsWith(github.ref, 'refs/tags/') |
80 | 80 | needs: |
81 | | - - lint |
82 | | - - test |
| 81 | + - lint |
| 82 | + - test |
83 | 83 | runs-on: ubuntu-latest |
84 | 84 | steps: |
85 | | - - name: Set up QEMU |
86 | | - uses: docker/setup-qemu-action@v2 |
87 | | - - uses: actions/setup-go@v3 |
88 | | - with: |
89 | | - go-version: '1.24' |
90 | | - - uses: actions/checkout@v3 |
91 | | - with: |
92 | | - fetch-depth: 0 |
93 | | - - uses: goreleaser/goreleaser-action@v2 |
94 | | - with: |
95 | | - args: release |
96 | | - env: |
97 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + - name: Set up QEMU |
| 86 | + uses: docker/setup-qemu-action@v2 |
| 87 | + - uses: actions/setup-go@v3 |
| 88 | + with: |
| 89 | + go-version: "1.24" |
| 90 | + - uses: actions/checkout@v3 |
| 91 | + with: |
| 92 | + fetch-depth: 0 |
| 93 | + - uses: goreleaser/goreleaser-action@v2 |
| 94 | + with: |
| 95 | + args: release |
| 96 | + env: |
| 97 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments