Skip to content

Commit

Permalink
Add Publish Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kaozenn committed Sep 27, 2023
1 parent af2bda0 commit bd0c5cd
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish

on:
push:
branches: ['main']
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
ECR_REPOSITORY_URL: 673156464838.dkr.ecr.us-west-2.amazonaws.com
ECR_REPOSITORY_NAME: on-chain-voting

jobs:
publish-server-image:
name: Build and Push Docker Image
runs-on: minafoundation-default-runners
steps:
- name: πŸ“₯ Checkout
uses: actions/checkout@v3
- name: πŸ¦€ Get node-stats-collector version from Cargo.toml.
id: ocv-server
uses: dante-signal31/[email protected]
with:
cargo_toml_folder: ./server/
- name: 🏷️ Generate Tag
run: echo "TAG=server-${{ steps.ocv-server.outputs.app_version }}-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: πŸ”‘ ECR Login
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: πŸ” Check if Tag already exists
id: checktag
uses: tyriis/docker-image-tag-exists@main
with:
registry: ${{ env.ECR_REPOSITORY_URL}}
repository: ${{ env.ECR_REPOSITORY_NAME }}
tag: ${{ env.TAG }}
- name: πŸ› οΈ Build node-stats-collector Docker Image
if: steps.checktag.outputs.tag == 'not found'
run: docker build -t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}:${{ env.TAG }} .
- name: 🚚 Push node-stats-collector Docker Image
if: steps.checktag.outputs.tag == 'not found'
run: docker push ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}:${{ env.TAG }}
- name: πŸ“ Release Notes
run: |
echo "Generate Release Notes"
echo "TODO: Generate Release Notes (https://github.com/MinaProtocol/mf-devops-workflows/issues/23)"

0 comments on commit bd0c5cd

Please sign in to comment.