fix docker build #7
Workflow file for this run
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: Release docker images | |
on: | |
push: | |
tags: | |
- v** | |
env: | |
ECR_ENABLED: true | |
ECR_REPO: public.ecr.aws/l9h3g6c6/injective-price-oracle | |
GHCR_ENABLED: false | |
GHCR_REPO: ghcr.io/injectivelabs/injective-price-oracle | |
jobs: | |
multi-release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout injective-price-oracle | |
uses: actions/checkout@master | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: Log-in to ghcr.io | |
if: env.GHCR_ENABLED == 'true' | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Login to Public ECR | |
if: env.ECR_ENABLED == 'true' | |
uses: docker/login-action@v2 | |
with: | |
registry: public.ecr.aws | |
username: ${{ secrets.AWS_KEY }} | |
password: ${{ secrets.AWS_SECRET }} | |
env: | |
AWS_REGION: us-east-1 | |
- name: Build | |
run: | | |
TAG=${{ github.ref_name }} | |
[[ $ECR_ENABLED == "false" ]] || docker buildx build --tag $ECR_REPO:$TAG --tag $ECR_REPO:latest --platform linux/amd64,linux/arm64 --push . | |
[[ $GHCR_ENABLED == "false" ]] || docker buildx build --tag $GHCR_REPO:$TAG --tag $GHCR_REPO:latest --platform linux/amd64,linux/arm64 --push . |