Skip to content

chore: trigger pipeline #10

chore: trigger pipeline

chore: trigger pipeline #10

name: Frontend Graffiti Production Pipeline
on:
push:
paths:
- 'aepp/**'
branches:
- master
env:
ENV: "prd"
APP: "aepp-graffiti"
concurrency: graffiti_production_environment
jobs:
main:
runs-on: ubuntu-latest
name: Frontend Graffiti Production Pipeline
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
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: Get commit sha on push
if: github.event_name == 'push'
id: git-sha
shell: bash
run: |
echo GIT_SHA=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Extract metadata for docker
if: github.event_name == 'push'
id: meta
uses: docker/metadata-action@v3
with:
images: aeternity/aepp-grafitti
tags: |
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'master') }}
type=raw,value=${{ steps.release.outputs.tag_name }},enable=${{ endsWith(GitHub.ref, 'master') }}
type=ref,event=tag
- name: Build and push docker image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
context: ./aepp
file: ./aepp/Dockerfile
build-args: COMMAND=prd
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
with:
repository: aeternity/gitops-apps.git
ref: prd
persist-credentials: false
fetch-depth: 0
- name: Production Deploy
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: ${{ 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