Push refresh service to AWS ECR #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish refresh service | |
on: | |
workflow_dispatch: | |
jobs: | |
build_refresh_service: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install zip and wget utils | |
run: mkdir ./circuits && sudo apt-get install -y zip unzip wget | |
- name: Get current branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Download latest circuits 'latest.zip' from S3 | |
if: steps.specific_circuits.outcome != 'success' | |
run: wget https://iden3-circuits-bucket.s3.eu-west-1.amazonaws.com/latest.zip -P ./circuits | |
- name: Unzip circuits to folder | |
if: steps.specific_circuits.outcome != 'success' | |
run: cd circuits && unzip latest.zip && cd - && pwd | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: build and deploy to ghcr.io | |
env: | |
GITHUB_REF: ${{ github.ref}} | |
run: | | |
ref="$(echo ${GITHUB_REF} | cut -d'/' -f3)" | |
echo GITHUB_REF - $ref | |
docker buildx build --push \ | |
--platform linux/amd64 \ | |
-t ghcr.io/0xpolygonid/refresh-service:${ref} -t ghcr.io/0xpolygonid/refresh-service:dev . |