Skip to content

Commit

Permalink
github action for push container
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-korotya committed Oct 12, 2023
1 parent 3a44997 commit 3be3522
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/push-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 .

0 comments on commit 3be3522

Please sign in to comment.