Skip to content

Commit 0cefa17

Browse files
Clinton WerthClinton Werth
authored andcommitted
update action to deploy container artifact
1 parent cdfacd4 commit 0cefa17

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

.github/workflows/aws_dev.deploy.yaml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
workflow_dispatch:
88

99
permissions:
10-
id-token: write
1110
contents: read
11+
packages: write
1212

1313
jobs:
1414
build-and-push:
@@ -25,31 +25,18 @@ jobs:
2525
echo "IMAGE_TAG=dev" >> $GITHUB_ENV
2626
fi
2727
28-
- name: AWS config
29-
uses: aws-actions/configure-aws-credentials@v4
28+
- name: Login to Github Registry ghcr.io
29+
uses: docker/login-action@v3
3030
with:
31-
role-to-assume: ${{ secrets.AWS_DEV_ROLE }}
32-
role-session-name: GithubNGAGeointSession
33-
aws-region: ${{ secrets.AWS_DEV_REGION }}
34-
35-
- name: AWS ECR Login
36-
id: ecr-login
37-
uses: aws-actions/amazon-ecr-login@v2
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
3834

3935
- name: Build Docker image
40-
env:
41-
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
42-
REPOSITORY: "/mage"
43-
IMAGE_TAG: ${{ env.IMAGE_TAG }}
4436
run: |
45-
docker build -t $REGISTRY$REPOSITORY:$IMAGE_TAG .
37+
docker build -t ghcr.io/${{ github.repository }}/mage:$IMAGE_TAG .
4638
4739
- name: Push Image
48-
if: github.ref =='refs/heads/test' || github.ref =='refs/heads/develop'
49-
env:
50-
SERVICE: "mage${{ env.IMAGE_TAG }}"
51-
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
52-
REPOSITORY: "/mage"
53-
IMAGE_TAG: ${{ env.IMAGE_TAG }}
40+
# if: github.ref =='refs/heads/test' || github.ref =='refs/heads/develop'
5441
run: |
55-
docker push $REGISTRY$REPOSITORY:$IMAGE_TAG
42+
docker push ghcr.io/${{ github.repository }}/mage:$IMAGE_TAG

0 commit comments

Comments
 (0)