Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvire committed Jul 25, 2023
1 parent 0df7eb2 commit 3e0214c
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Show environment
run: env
Expand All @@ -40,7 +40,7 @@ jobs:
echo "AppEnv=${APP_ENV}" >> $GITHUB_OUTPUT
- name: Build docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
load: true
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Configure AWS credentials (SIL)
id: aws_sil
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.SIL__AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SIL__AWS_SECRET_ACCESS_KEY }}
Expand All @@ -71,7 +71,7 @@ jobs:
registries: ${{ secrets.SIL__AWS_ECR_ACCOUNT }}

- name: Push to AWS ECR (SIL)
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -82,7 +82,7 @@ jobs:
- name: Configure AWS credentials (FCBH)
if: ${{ steps.meta.outputs.AppEnv == 'prd' }}
id: aws_fcbh
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.FCBH__AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.FCBH__AWS_SECRET_ACCESS_KEY }}
Expand All @@ -97,37 +97,23 @@ jobs:

- name: Push to AWS ECR (FCBH)
if: ${{ steps.meta.outputs.AppEnv == 'prd' }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
"${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-agent-${{ steps.meta.outputs.AppEnv }}:${{ steps.meta.outputs.DockerTag }}"
"${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-agent-${{ steps.meta.outputs.AppEnv }}:${{ steps.version.outputs.VersionTag }}"
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

# - name: Push to DockerHub
# uses: docker/build-push-action@v2
# with:
# context: .
# push: true
# tags: |
# "sillsdev/appbuilder-agent-${{ steps.meta.outputs.AppEnv }}:${{ steps.meta.outputs.DockerTag }}"

- name: Login to GHCR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to GHCR
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -137,7 +123,6 @@ jobs:
- name: Cleanup older untagged packages, keep 2
uses: actions/delete-package-versions@v4
with:
context: .
package-name: "appbuilder-agent-${{ steps.meta.outputs.AppEnv }}"
package-type: 'container'
min-versions-to-keep: 2
Expand All @@ -146,7 +131,6 @@ jobs:
- name: Cleanup older all packages, keep 6
uses: actions/delete-package-versions@v4
with:
context: .
package-name: "appbuilder-agent-${{ steps.meta.outputs.AppEnv }}"
package-type: 'container'
min-versions-to-keep: 6
Expand Down

0 comments on commit 3e0214c

Please sign in to comment.