Skip to content

Commit ee232ef

Browse files
authored
Merge pull request #1450 from aeternity/release/v1.0.2
Release/v1.0.2
2 parents 4cafc4c + b3e4603 commit ee232ef

12 files changed

Lines changed: 518 additions & 435 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/prod-docker.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Production Aepp Base Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
release:
8+
types: [created]
9+
10+
env:
11+
ENV: "prd"
12+
APP: "aepp-base"
13+
14+
jobs:
15+
main:
16+
runs-on: ubuntu-latest
17+
name: Production Aepp Base Pipeline
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 100
22+
23+
- uses: GoogleCloudPlatform/release-please-action@v2
24+
id: release
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
release-type: node
28+
package-name: ""
29+
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}]'
30+
31+
- name: Set up Docker Buildx
32+
id: buildx
33+
# Use the action from the master, as we've seen some inconsistencies with @v1
34+
# Issue: https://github.com/docker/build-push-action/issues/286
35+
uses: docker/setup-buildx-action@master
36+
# Only worked for us with this option on �‍♂️
37+
with:
38+
install: true
39+
40+
- name: Cache Docker layers
41+
uses: actions/cache@v2
42+
with:
43+
path: /tmp/.buildx-cache
44+
# Key is named differently to avoid collision
45+
key: ${{ runner.os }}-${{ env.ENV }}-buildx-${{ github.sha }}
46+
restore-keys: |
47+
${{ runner.os }}-${{ env.ENV }}-buildx
48+
49+
- name: Log in to dockerhub
50+
uses: docker/login-action@v1
51+
with:
52+
username: ${{ secrets.DOCKERHUB_USER }}
53+
password: ${{ secrets.DOCKERHUB_PASS }}
54+
55+
- name: Extract metadata for docker
56+
if: |
57+
github.event_name == 'push' ||
58+
startsWith(github.ref, 'refs/tags/v')
59+
id: meta
60+
uses: docker/metadata-action@v3
61+
with:
62+
images: aeternity/aepp-base
63+
tags: |
64+
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'master') }}
65+
type=raw,value=${{ steps.release.outputs.tag_name }},enable=${{ endsWith(GitHub.ref, 'master') }}
66+
type=ref,event=tag
67+
type=ref,event=pr
68+
69+
- name: Build and push docker image
70+
if: |
71+
github.event_name == 'push' ||
72+
startsWith(github.ref, 'refs/tags/v')
73+
uses: docker/build-push-action@v2
74+
with:
75+
context: .
76+
file: Dockerfile
77+
push: true
78+
tags: ${{ steps.meta.outputs.tags }}
79+
labels: ${{ steps.meta.outputs.labels }}
80+
cache-from: type=local,src=/tmp/.buildx-cache
81+
# Note the mode=max here
82+
# More: https://github.com/moby/buildkit#--export-cache-options
83+
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
84+
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
85+
86+
- name: Move cache
87+
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
88+
run: |
89+
rm -rf /tmp/.buildx-cache
90+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
91+
92+
- uses: actions/checkout@v2
93+
with:
94+
repository: aeternity/gitops-apps.git
95+
ref: prd
96+
persist-credentials: false
97+
fetch-depth: 0
98+
99+
- name: Production Deploy
100+
if: ${{ steps.release.outputs.release_created }}
101+
uses: aeternity/ae-github-actions/argocd-deploy@v4
102+
with:
103+
url-prefix: ${{ steps.release.outputs.tag_name }}
104+
env: ${{ env.ENV }}
105+
app: ${{ env.APP }}
106+
107+
- name: Push changes
108+
uses: ad-m/github-push-action@master
109+
with:
110+
repository: aeternity/gitops-apps
111+
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
112+
branch: prd
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Staging Aepp Base Pipeline
2+
3+
on:
4+
pull_request:
5+
branches: [ master, develop ]
6+
types: [ opened, synchronize, closed ]
7+
8+
env:
9+
PR_NUMBER: ${{ github.event.pull_request.number }}
10+
ENV: "stg"
11+
APP: "aepp-base"
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-latest
16+
name: Staging Aepp Base Pipeline
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Docker Buildx
23+
id: buildx
24+
# Use the action from the master, as we've seen some inconsistencies with @v1
25+
# Issue: https://github.com/docker/build-push-action/issues/286
26+
uses: docker/setup-buildx-action@master
27+
# Only worked for us with this option on
28+
with:
29+
install: true
30+
31+
- name: Cache Docker layers
32+
uses: actions/cache@v2
33+
with:
34+
path: /tmp/.buildx-cache
35+
# Key is named differently to avoid collision
36+
key: ${{ runner.os }}-${{ env.ENV }}-buildx-${{ github.sha }}
37+
restore-keys: |
38+
${{ runner.os }}-${{ env.ENV }}-buildx
39+
40+
- name: Log in to dockerhub
41+
uses: docker/login-action@v1
42+
with:
43+
username: ${{ secrets.DOCKERHUB_USER }}
44+
password: ${{ secrets.DOCKERHUB_PASS }}
45+
46+
- name: Extract metadata for docker
47+
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
48+
id: meta
49+
uses: docker/metadata-action@v3
50+
with:
51+
images: aeternity/aepp-base
52+
tags: |
53+
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'master') }}
54+
type=ref,event=tag
55+
type=ref,event=pr
56+
57+
- name: Get commit sha on PR Sync
58+
if: github.event_name == 'pull_request' && github.event.action == 'synchronize'
59+
id: git-sha
60+
shell: bash
61+
run: |
62+
echo "::set-output name=git-sha::$(git rev-parse --short HEAD)"
63+
64+
- name: Build and push docker image
65+
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
66+
uses: docker/build-push-action@v2
67+
with:
68+
context: .
69+
file: Dockerfile
70+
push: true
71+
tags: ${{ steps.meta.outputs.tags }}
72+
labels: ${{ steps.meta.outputs.labels }}
73+
cache-from: type=local,src=/tmp/.buildx-cache
74+
# Note the mode=max here
75+
# More: https://github.com/moby/buildkit#--export-cache-options
76+
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
77+
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
78+
79+
- name: Move cache
80+
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
81+
run: |
82+
rm -rf /tmp/.buildx-cache
83+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
84+
85+
- uses: actions/checkout@v2
86+
with:
87+
repository: aeternity/gitops-apps.git
88+
ref: stg
89+
persist-credentials: false
90+
fetch-depth: 0
91+
92+
- name: Staging PR Sync
93+
if: github.event_name == 'pull_request' && github.event.action == 'synchronize'
94+
uses: aeternity/ae-github-actions/argocd-pr-sync@v4
95+
with:
96+
git-sha: ${{ steps.git-sha.outputs.git-sha }}
97+
url-prefix: pr-${{ env.PR_NUMBER }}
98+
env: ${{ env.ENV }}
99+
app: ${{ env.APP }}
100+
101+
- name: Staging deploy
102+
if: github.event_name == 'pull_request' && github.event.action == 'opened'
103+
uses: aeternity/ae-github-actions/argocd-deploy@v4
104+
with:
105+
url-prefix: pr-${{ env.PR_NUMBER }}
106+
env: ${{ env.ENV }}
107+
app: ${{ env.APP }}
108+
109+
- name: Staging undeploy
110+
if: github.event_name == 'pull_request' && github.event.action == 'closed' && startsWith(github.head_ref, 'release') != true
111+
uses: aeternity/ae-github-actions/argocd-undeploy@v4
112+
with:
113+
url-prefix: pr-${{ env.PR_NUMBER }}
114+
env: ${{ env.ENV }}
115+
app: ${{ env.APP }}
116+
117+
- name: Print PR url
118+
uses: unsplash/comment-on-pr@v1.3.0
119+
if: github.event_name == 'pull_request' && github.event.action == 'opened'
120+
env:
121+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122+
with:
123+
msg: Deployed to https://pr-${{ env.PR_NUMBER }}-${{ env.APP }}.${{ env.ENV }}.aepps.com
124+
check_for_duplicate_msg: true
125+
126+
- name: Push changes
127+
uses: ad-m/github-push-action@master
128+
with:
129+
repository: aeternity/gitops-apps
130+
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
131+
branch: stg

.travis.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)