-
Notifications
You must be signed in to change notification settings - Fork 24
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: update pipelines and add develop branch deploy #1478
Changes from all commits
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,102 @@ | ||||||
name: Develop Aepp Base pipelines | ||||||
|
||||||
on: | ||||||
push: | ||||||
branches: | ||||||
- develop | ||||||
|
||||||
env: | ||||||
ENV: "dev" | ||||||
APP: "aepp-base" | ||||||
|
||||||
concurrency: aescan_develop_environment | ||||||
|
||||||
jobs: | ||||||
main: | ||||||
runs-on: ubuntu-latest | ||||||
environment: develop | ||||||
name: Develop Pipeline Aepp Base | ||||||
steps: | ||||||
- uses: actions/checkout@v3 | ||||||
with: | ||||||
fetch-depth: 0 | ||||||
Comment on lines
+21
to
+22
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. it doesn't seem necessary to fetch the whole base-app history |
||||||
|
||||||
- name: Get commit sha on PR Sync | ||||||
if: github.event_name == 'push' | ||||||
id: git-sha | ||||||
shell: bash | ||||||
run: | | ||||||
echo GIT_SHA=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT | ||||||
|
||||||
- name: Set up Docker Buildx | ||||||
id: buildx | ||||||
uses: docker/setup-buildx-action@master | ||||||
# Only worked for us with this option on | ||||||
with: | ||||||
install: true | ||||||
|
||||||
- name: Cache Docker layers | ||||||
uses: actions/cache@v2 | ||||||
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
|
||||||
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' | ||||||
id: meta | ||||||
uses: docker/metadata-action@v3 | ||||||
with: | ||||||
images: aeternity/aescan | ||||||
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. I'm not sure that it should be |
||||||
tags: | | ||||||
type=raw,value=develop,enable=${{ endsWith(GitHub.ref, 'develop') }} | ||||||
|
||||||
- name: Build and push docker image | ||||||
if: github.event_name == 'push' | ||||||
uses: docker/build-push-action@v2 | ||||||
with: | ||||||
context: . | ||||||
file: Dockerfile | ||||||
push: true | ||||||
tags: ${{ steps.meta.outputs.tags }} | ||||||
labels: ${{ steps.meta.outputs.labels }} | ||||||
cache-from: type=local,src=/tmp/.buildx-cache | ||||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | ||||||
|
||||||
- name: Move cache | ||||||
if: github.event_name == 'push' | ||||||
run: | | ||||||
rm -rf /tmp/.buildx-cache | ||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||||||
|
||||||
- uses: actions/checkout@v2 | ||||||
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
|
||||||
with: | ||||||
repository: aeternity/gitops-apps.git | ||||||
token: ${{ secrets.BOT_GITHUB_TOKEN }} | ||||||
ref: dev | ||||||
persist-credentials: false | ||||||
fetch-depth: 0 | ||||||
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
|
||||||
|
||||||
- name: Latest Develop Branch Deploy on Push | ||||||
if: github.event_name == 'push' | ||||||
uses: aeternity/ae-github-actions/argocd-pr-sync@v4 | ||||||
with: | ||||||
git-sha: ${{ steps.git-sha.outputs.GIT_SHA }} | ||||||
url-prefix: develop | ||||||
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: dev |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
name: Staging Aepp Base Pipeline | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
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. What is the difference compared to the default setting? |
||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
|
@@ -50,8 +51,6 @@ jobs: | |
with: | ||
images: aeternity/aepp-base | ||
tags: | | ||
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'master') }} | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
|
||
- name: Get commit sha on PR Sync | ||
|
@@ -89,6 +88,12 @@ jobs: | |
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Chekc the initial PR deployment status before make a PR Sync. | ||
if: github.event_name == 'pull_request' && github.event.action == 'synchronize' | ||
uses: aeternity/ae-github-actions/deploy-status@v7 | ||
with: | ||
url: https://pr-${{ env.PR_NUMBER }}-${{ env.APP }}.${{ env.ENV }}.aepps.com | ||
|
||
- name: Staging PR Sync | ||
if: github.event_name == 'pull_request' && github.event.action == 'synchronize' | ||
uses: aeternity/ae-github-actions/argocd-pr-sync@v4 | ||
|
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.
is it should be
aescan
?