-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull semvering into separate workflow
- Loading branch information
1 parent
7bd2d48
commit a5c44e2
Showing
1 changed file
with
14 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,15 @@ on: | |
repo-name: | ||
required: true | ||
type: string | ||
tag: | ||
required: true | ||
type: string | ||
|
||
secrets: | ||
AWS_ACCESS_KEY_ID: | ||
required: true | ||
AWS_SECRET_ACCESS_KEY: | ||
required: true | ||
DOCKER_REGISTRY: | ||
required: true | ||
|
||
|
@@ -77,51 +82,16 @@ jobs: | |
echo "New tag: ${new_tag}" | ||
echo "new_tag=${new_tag}" >> "$GITHUB_OUTPUT" | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
- name: Semver tag | ||
uses: ./.github/workflows/semver.yml@main | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-west-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/[email protected] | ||
|
||
- name: Docker pull, retag and push | ||
env: | ||
NEW_TAG: ${{ steps.determine_next_tag.outputs.new_tag }} | ||
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
docker pull ${DOCKER_REGISTRY}/${{ inputs.repo-name }}:main-${GITHUB_SHA::8} | ||
docker tag ${DOCKER_REGISTRY}/${{ inputs.repo-name }}:main-${GITHUB_SHA::8} ${{ inputs.repo-name }}:main-${GITHUB_SHA::8} | ||
.github/retag-and-push.sh ${{ inputs.repo-name }} main-${GITHUB_SHA::8} | ||
repo-name: ${{ inputs.repo-name }} | ||
tag: ${{ inputs.tag }} | ||
|
||
semver-for-manually-created-tags: | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-west-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Docker pull, retag and push | ||
env: | ||
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
docker pull ${DOCKER_REGISTRY}/${{ inputs.repo-name }}:main-${GITHUB_SHA::8} | ||
docker tag ${DOCKER_REGISTRY}/${{ inputs.repo-name }}:main-${GITHUB_SHA::8} ${{ inputs.repo-name }}:main-${GITHUB_SHA::8} | ||
.github/retag-and-push.sh ${{ inputs.repo-name }} main-${GITHUB_SHA::8} | ||
uses: climatepolicyradar/reusable-workflows/.github/workflows/semver.yml@main | ||
secrets: inherit | ||
with: | ||
repo-name: ${{ inputs.repo-name }} | ||
tag: ${{ inputs.tag }} |