Skip to content

Commit 7576918

Browse files
author
Dev Kalra
authored
[fortuna] push fortuna to ghrc (#1295)
* [fortuna] push fortuna to ghrc * precommit fix * test file path * address comment
1 parent 2bfbfed commit 7576918

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

.github/workflows/push-fortuna-image.yml

+21-13
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
permissions:
1313
contents: read
1414
id-token: write
15+
packages: write
16+
env:
17+
REGISTRY: ghcr.io
18+
IMAGE_NAME: pyth-network/fortuna
1519
jobs:
1620
fortuna-image:
1721
runs-on: ubuntu-latest
@@ -27,18 +31,22 @@ jobs:
2731
if: ${{ !startsWith(github.ref, 'refs/tags/fortuna-v') }}
2832
run: |
2933
echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
30-
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
34+
- name: Log in to the Container registry
35+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
3136
with:
32-
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
33-
aws-region: eu-west-2
34-
- uses: docker/login-action@v2
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Extract metadata (tags, labels) for Docker
41+
id: metadata_fortuna
42+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
3543
with:
36-
registry: public.ecr.aws
37-
env:
38-
AWS_REGION: us-east-1
39-
- run: |
40-
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f fortuna/Dockerfile .
41-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
42-
env:
43-
ECR_REGISTRY: public.ecr.aws
44-
ECR_REPOSITORY: pyth-network/fortuna
44+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45+
- name: Build and push server docker image
46+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
47+
with:
48+
context: .
49+
file: "./fortuna/Dockerfile"
50+
push: true
51+
tags: ${{ steps.metadata_fortuna.outputs.tags }}
52+
labels: ${{ steps.metadata_fortuna.outputs.labels }}

0 commit comments

Comments
 (0)