diff --git a/.github/workflows/push-fortuna-image.yml b/.github/workflows/push-fortuna-image.yml index 44b3372e..1351f425 100644 --- a/.github/workflows/push-fortuna-image.yml +++ b/.github/workflows/push-fortuna-image.yml @@ -12,6 +12,10 @@ on: permissions: contents: read id-token: write + packages: write +env: + REGISTRY: ghcr.io + IMAGE_NAME: pyth-network/fortuna jobs: fortuna-image: runs-on: ubuntu-latest @@ -27,18 +31,22 @@ jobs: if: ${{ !startsWith(github.ref, 'refs/tags/fortuna-v') }} run: | echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}" - - uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: - role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr - aws-region: eu-west-2 - - uses: docker/login-action@v2 + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: metadata_fortuna + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - registry: public.ecr.aws - env: - AWS_REGION: us-east-1 - - run: | - DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f fortuna/Dockerfile . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - env: - ECR_REGISTRY: public.ecr.aws - ECR_REPOSITORY: pyth-network/fortuna + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push server docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + file: "./fortuna/Dockerfile" + push: true + tags: ${{ steps.metadata_fortuna.outputs.tags }} + labels: ${{ steps.metadata_fortuna.outputs.labels }}