Skip to content

Commit

Permalink
tag current short sha and latest when pushing images to github
Browse files Browse the repository at this point in the history
  • Loading branch information
mxfactorial committed Dec 20, 2024
1 parent f7e7297 commit 46a316b
Showing 1 changed file with 78 additions and 52 deletions.
130 changes: 78 additions & 52 deletions .github/workflows/build-all-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
balance_by_account:
name: balance-by-account
runs-on: ubuntu-latest
Expand All @@ -38,16 +40,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
graphql:
name: graphql
runs-on: ubuntu-latest
Expand All @@ -57,16 +61,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
request_create:
name: request-create
runs-on: ubuntu-latest
Expand All @@ -76,16 +82,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
request_approve:
name: request-approve
runs-on: ubuntu-latest
Expand All @@ -95,16 +103,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
request_by_id:
name: request-by-id
runs-on: ubuntu-latest
Expand All @@ -114,16 +124,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
requests_by_account:
name: requests-by-account
runs-on: ubuntu-latest
Expand All @@ -133,16 +145,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
transaction_by_id:
name: transaction-by-id
runs-on: ubuntu-latest
Expand All @@ -152,16 +166,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
transactions_by_account:
name: transactions-by-account
runs-on: ubuntu-latest
Expand All @@ -171,16 +187,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
event:
name: event
runs-on: ubuntu-latest
Expand All @@ -190,16 +208,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
measure:
name: measure
runs-on: ubuntu-latest
Expand All @@ -209,16 +229,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
auto_confirm:
name: auto-confirm
runs-on: ubuntu-latest
Expand All @@ -228,16 +250,18 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx .
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME
go_migrate:
name: go-migrate
runs-on: ubuntu-latest
Expand All @@ -247,13 +271,15 @@ jobs:
- uses: actions/checkout@v4
- name: build image
run: bash scripts/build-image-job.sh --service-name $SERVICE_NAME --build-ctx ./migrations/go-migrate # non root build context
- name: tag image
run: docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: tag image with current short sha and latest
run: |
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:${GITHUB_SHA:0:7}
docker tag $SERVICE_NAME:latest ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: log into container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push image
run: docker push ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME:latest
- name: push images
run: docker push --all-tags ${{ env.GITHUB_REGISTRY }}/${{ github.repository }}/$SERVICE_NAME

0 comments on commit 46a316b

Please sign in to comment.