-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci(build): add mainnet and testnet gh actions build #109
Changes from 10 commits
41ec0e5
3189eed
a621658
c141157
f05755c
3e8d18b
4212300
16a8c85
d282660
af859d5
b474a2d
388b6ee
ae72672
0a86e68
a54c509
f7dd8d9
0c18fd8
2e0027d
f85e234
2e83204
4ffa817
61c8277
07fd366
fb1a15d
d4f364b
cd80810
758ac31
b950e46
41799ec
205b824
e0af085
94a39eb
859a52d
878ab47
09629f3
9a30415
71452c5
38aa55f
4be7fbd
a14d84f
de5b998
ae9dfa9
b90f73f
dd0b793
6528af8
88b4531
c471cf4
7504ed5
3a9cbe4
680a1f7
8df4c67
0d0011b
d76b8aa
0b3c3de
9bfb906
ce0b26d
7d21fde
9cce742
2dfde42
b02ac26
fdddbd1
24c5f0b
76690ef
dc884a1
9726e70
dde5db4
690e4ae
dd95d17
22d73ac
8c7dba3
983f043
ee6402b
22a8557
e111dc7
8a0a4c3
7f94f8c
5eef237
dd54f90
77a6ef5
cf0c46a
2997bab
99cbc23
8ac9369
17eaea5
8fca84c
c0f75fb
cb0e9f8
0fa7506
f669f16
21ae96d
dcbe210
18336a6
81fc32a
74b0b11
8fb7979
fe143c7
1ab718c
ba1cef2
35a4bbd
9c83bc2
76903ec
d016a0a
d70edd2
7c083b6
435a7c7
33126d3
96874f1
3a91f52
c161bc9
0ac9ecc
0c238d6
c07f847
993e4cd
aec56ae
2573aac
42a2d53
f44070d
81c85c6
9ddab7d
af4ece8
81eeeeb
42a5071
26ca4bb
6b7a851
c581cd4
3e39f7f
b0f21a4
817a08b
5639db5
83e5e60
587e117
c1cd467
dc83fa8
6ecf761
87189a5
630f926
193d4dc
338f46a
82520f9
7eb8971
be4bd04
5240082
e25855c
a96562a
920c2ee
62b84f0
714e992
1c386bb
07105e0
d75c518
3cf1eaf
b012e7a
39a3d88
3288ebe
d9eea53
73b7fd4
91c9b8c
edce874
dd1ec98
290c99d
b98009f
dfe21ac
d909d58
6d737c3
761dbcc
a0816ad
7af4887
99e9153
870829e
a05ed48
05253a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Mdw Frontend Mainnet | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
|
||
name: Build Docker | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Log in to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASS }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: nginx.Dockerfile | ||
build-args: | | ||
NUXT_APP_NODE_URL: "https://mainnet.aeternity.io/mdw" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. newer versions have some additional ENV vars
otherDeployments point to an url for the explorer of the other network (on mainnet it points to tesnet and viceversa) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okey , thanks , we can sync on that. |
||
NUXT_APP_NODE_WS: "wss://mainnet.aeternity.io/mdw/websocket" | ||
NUXT_APP_NETWORK_NAME: "MAIN NET" | ||
NUXT_APP_ENABLE_FAUCET: "false" | ||
NUXT_APP_FAUCET_API: "https://testnet.faucet.aepps.com/account" | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: aeternity/mdw-frontend:mainnet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO this should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We discussed it with Dincho I think , we have to sync on that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We keep the old repo and tags for now: |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,118 @@ | ||||||
name: Production Mainnet Pipeline | ||||||
|
||||||
on: | ||||||
push: | ||||||
branches: | ||||||
- master | ||||||
release: | ||||||
types: [created] | ||||||
|
||||||
env: | ||||||
ENV: "prd" | ||||||
APP: "mdw-frontend-mainnet" | ||||||
|
||||||
jobs: | ||||||
main: | ||||||
runs-on: ubuntu-latest | ||||||
name: Mainnet Production Pipeline | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
with: | ||||||
fetch-depth: 100 | ||||||
|
||||||
- uses: GoogleCloudPlatform/release-please-action@v2 | ||||||
id: release | ||||||
with: | ||||||
token: ${{ secrets.GITHUB_TOKEN }} | ||||||
release-type: node | ||||||
package-name: "" | ||||||
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"ci","section":"CI / CD","hidden":false},{"type":"test","section":"Testing","hidden":false},{"type":"refactor","section":"Refactorings","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]' | ||||||
|
||||||
- name: Set up Docker Buildx | ||||||
id: buildx | ||||||
# Use the action from the master, as we've seen some inconsistencies with @v1 | ||||||
# Issue: https://github.com/docker/build-push-action/issues/286 | ||||||
uses: docker/setup-buildx-action@master | ||||||
# Only worked for us with this option on �♂️ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some non utf-8 char landed here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will fix it. |
||||||
with: | ||||||
install: true | ||||||
|
||||||
- name: Cache Docker layers | ||||||
uses: actions/cache@v2 | ||||||
with: | ||||||
path: /tmp/.buildx-cache | ||||||
# Key is named differently to avoid collision | ||||||
key: ${{ runner.os }}-${{ env.ENV }}-buildx-${{ github.sha }} | ||||||
restore-keys: | | ||||||
${{ runner.os }}-${{ env.ENV }}-buildx | ||||||
|
||||||
- name: Log in to dockerhub | ||||||
uses: docker/login-action@v1 | ||||||
with: | ||||||
username: ${{ secrets.DOCKERHUB_USER }} | ||||||
password: ${{ secrets.DOCKERHUB_PASS }} | ||||||
|
||||||
- name: Extract metadata for docker | ||||||
if: | | ||||||
github.event_name == 'push' || | ||||||
startsWith(github.ref, 'refs/tags/v') | ||||||
id: meta | ||||||
uses: docker/metadata-action@v3 | ||||||
with: | ||||||
images: aeternity/mdw-frontend:mainnet # has to be changed | ||||||
tags: | | ||||||
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'main') }} | ||||||
type=raw,value=${{ steps.release.outputs.tag_name }},enable=${{ endsWith(GitHub.ref, 'main') }} | ||||||
type=ref,event=tag | ||||||
type=ref,event=pr | ||||||
|
||||||
- name: Build and push docker image | ||||||
if: | | ||||||
github.event_name == 'push' || | ||||||
startsWith(github.ref, 'refs/tags/v') | ||||||
uses: docker/build-push-action@v2 | ||||||
with: | ||||||
context: . | ||||||
file: nginx.Dockerfile | ||||||
build-args: | | ||||||
NUXT_APP_NODE_URL: "https://mainnet.aeternity.io/mdw" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
NUXT_APP_NODE_WS: "wss://mainnet.aeternity.io/mdw/websocket" | ||||||
NUXT_APP_NETWORK_NAME: "MAIN NET" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it possible to add Version here like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not quire sure how the code use this variables . We have to take a look. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
NUXT_APP_ENABLE_FAUCET: "false" | ||||||
NUXT_APP_FAUCET_API: "https://testnet.faucet.aepps.com/account" | ||||||
push: true | ||||||
tags: ${{ steps.meta.outputs.tags }} | ||||||
labels: ${{ steps.meta.outputs.labels }} | ||||||
cache-from: type=local,src=/tmp/.buildx-cache | ||||||
# Note the mode=max here | ||||||
# More: https://github.com/moby/buildkit#--export-cache-options | ||||||
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue | ||||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | ||||||
|
||||||
- name: Move cache | ||||||
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize' | ||||||
run: | | ||||||
rm -rf /tmp/.buildx-cache | ||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||||||
|
||||||
- uses: actions/checkout@v2 | ||||||
with: | ||||||
repository: aeternity/gitops-apps.git | ||||||
ref: prd | ||||||
persist-credentials: false | ||||||
fetch-depth: 0 | ||||||
|
||||||
- name: Production Deploy | ||||||
if: ${{ steps.release.outputs.release_created }} | ||||||
uses: aeternity/ae-github-actions/argocd-deploy@v4 | ||||||
with: | ||||||
url-prefix: ${{ steps.release.outputs.tag_name }} | ||||||
env: ${{ env.ENV }} | ||||||
app: ${{ env.APP }} | ||||||
|
||||||
- name: Push changes | ||||||
uses: ad-m/github-push-action@master | ||||||
with: | ||||||
repository: aeternity/gitops-apps | ||||||
github_token: ${{ secrets.BOT_GITHUB_TOKEN }} | ||||||
branch: prd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: Production Testnet Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
release: | ||
types: [created] | ||
|
||
env: | ||
ENV: "prd" | ||
APP: "mdw-frontend-testnet" | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
name: Testnet Production Pipeline | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 100 | ||
|
||
- uses: GoogleCloudPlatform/release-please-action@v2 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: node | ||
package-name: "" | ||
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"ci","section":"CI / CD","hidden":false},{"type":"test","section":"Testing","hidden":false},{"type":"refactor","section":"Refactorings","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]' | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
# Use the action from the master, as we've seen some inconsistencies with @v1 | ||
# Issue: https://github.com/docker/build-push-action/issues/286 | ||
uses: docker/setup-buildx-action@master | ||
# Only worked for us with this option on �♂️ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some bad char There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will fix. |
||
with: | ||
install: true | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
# Key is named differently to avoid collision | ||
key: ${{ runner.os }}-${{ env.ENV }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ env.ENV }}-buildx | ||
|
||
- name: Log in to dockerhub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASS }} | ||
|
||
- name: Extract metadata for docker | ||
if: | | ||
github.event_name == 'push' || | ||
startsWith(github.ref, 'refs/tags/v') | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: aeternity/mdw-frontend:testnet # has to be changed | ||
tags: | | ||
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'main') }} | ||
type=raw,value=${{ steps.release.outputs.tag_name }},enable=${{ endsWith(GitHub.ref, 'main') }} | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
|
||
- name: Build and push docker image | ||
if: | | ||
github.event_name == 'push' || | ||
startsWith(github.ref, 'refs/tags/v') | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: nginx.Dockerfile | ||
build-args: | | ||
NUXT_APP_NODE_URL: "https://testnet.aeternity.io/mdw" | ||
NUXT_APP_NODE_WS: "wss://testnet.aeternity.io/mdw/websocket" | ||
NUXT_APP_NETWORK_NAME: "TEST NET" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add version here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No idea from my side , we should verify that |
||
NUXT_APP_ENABLE_FAUCET: "false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. faucet should be "true" for testnet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okey ,thanks will change it. |
||
NUXT_APP_FAUCET_API: "https://testnet.faucet.aepps.com/account" | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
# Note the mode=max here | ||
# More: https://github.com/moby/buildkit#--export-cache-options | ||
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue | ||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | ||
|
||
- name: Move cache | ||
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize' | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
repository: aeternity/gitops-apps.git | ||
ref: prd | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Production Deploy | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: aeternity/ae-github-actions/argocd-deploy@v4 | ||
with: | ||
url-prefix: ${{ steps.release.outputs.tag_name }} | ||
env: ${{ env.ENV }} | ||
app: ${{ env.APP }} | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
repository: aeternity/gitops-apps | ||
github_token: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
branch: prd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather call this Explorer (yet not really important)