Skip to content

Commit

Permalink
Merge pull request #445 from aeternity/ci/update-pipeline
Browse files Browse the repository at this point in the history
ci: update prod pipeline
  • Loading branch information
mmpetarpeshev authored May 7, 2024
2 parents d636049 + a6bf24c commit 2cb61a1
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/prod-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,25 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --tags origin

- name: Get latest release tag
shell: bash
id: release_tag
run: echo TAG=$(git describe --tags HEAD --abbrev=0) >> $GITHUB_OUTPUT

- 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
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
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
Expand All @@ -70,10 +75,7 @@ jobs:
with:
images: aeternity/superhero-backend
tags: |
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'main') }}
type=raw,value=${{ needs.release.outputs.tag_name }},enable=${{ endsWith(GitHub.ref, 'main') }}
type=ref,event=tag
type=ref,event=pr
type=raw,value=${{ steps.release_tag.outputs.TAG }}
- name: Build and push docker image
if: |
Expand All @@ -87,9 +89,6 @@ jobs:
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
Expand All @@ -99,21 +98,22 @@ jobs:
- uses: actions/checkout@v2
with:
repository: aeternity/gitops-apps.git
repository: aeternity/gitops-apps-aelabs.git
token: ${{ secrets.BOT_GITHUB_TOKEN }}
ref: prd
persist-credentials: false
fetch-depth: 0

- name: Production Deploy
uses: aeternity/ae-github-actions/argocd-deploy@v4
with:
url-prefix: ${{ needs.release.outputs.tag_name }}
url-prefix: ${{ steps.release_tag.outputs.TAG }}
env: ${{ env.ENV }}
app: ${{ env.APP }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
repository: aeternity/gitops-apps
repository: aeternity/gitops-apps-aelabs
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
branch: prd

0 comments on commit 2cb61a1

Please sign in to comment.