forked from pavlospt/render-template
-
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.
Refactor after fork in Blueground org
- Loading branch information
Showing
5 changed files
with
67 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,32 +6,44 @@ on: | |
- main | ||
|
||
env: | ||
DOCKER_IMAGE: pavlospt/render-template | ||
DOCKER_IMAGE_REPO: bluegroundltd/render-template | ||
PUBLIC_ECR_REGISTRY: public.ecr.aws/l2j5o5b6 | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
runs-on: arc-runner-set | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and push Docker image | ||
uses: chuhlomin/actions/docker-build-push@main | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
username: pavlospt | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
image_name: ${{ env.DOCKER_IMAGE }} | ||
tags: | | ||
${{ env.DOCKER_IMAGE }}:${{ github.sha }} | ||
${{ env.DOCKER_IMAGE }}:latest | ||
role-to-assume: arn:aws:iam::489098123993:role/github-actions-assumable-role | ||
aws-region: us-east-1 | ||
- name: Login to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
registry-type: public | ||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 7 | ||
- name: Build & push to public ECR | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ env.PUBLIC_ECR_REGISTRY}}/${{ env.DOCKER_IMAGE_REPO }}:${{ steps.short-sha.outputs.sha }} | ||
- name: Test action | ||
uses: ./ # Uses an action in the root directory | ||
id: render | ||
with: | ||
template: ./testdata/template.txt | ||
vars: | | ||
name: world | ||
- name: Get `result` output | ||
run: echo "${{ steps.render.outputs.result }}" |
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,40 +6,48 @@ on: | |
- '*' | ||
|
||
env: | ||
DOCKER_IMAGE: pavlospt/render-template | ||
DOCKER_IMAGE_REPO: bluegroundltd/render-template | ||
PUBLIC_ECR_REGISTRY: public.ecr.aws/l2j5o5b6 | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
runs-on: arc-runner-set | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
uses: actions/checkout@v4 | ||
- name: Get the tag | ||
id: get_tag | ||
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | ||
|
||
- name: Build and push Docker image | ||
uses: chuhlomin/actions/docker-build-push@main | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::489098123993:role/github-actions-assumable-role | ||
aws-region: us-east-1 | ||
- name: Login to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
username: pavlospt | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
image_name: ${{ env.DOCKER_IMAGE }} | ||
tags: ${{ env.DOCKER_IMAGE }}:${{ steps.get_tag.outputs.tag }} | ||
registry-type: public | ||
- name: Build & push to public ECR | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ env.PUBLIC_ECR_REGISTRY}}/${{ env.DOCKER_IMAGE_REPO }}:${{ steps.get_tag.outputs.tag }} | ||
|
||
update-tag: | ||
runs-on: ubuntu-latest | ||
environment: v1 # requires approval | ||
runs-on: arc-runner-set | ||
needs: release | ||
if: startsWith(github.ref, 'refs/tags/v1.') | ||
if: startsWith(github.ref, 'refs/tags/v2.') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Update v1 tag | ||
uses: actions/checkout@v4 | ||
- name: Update v2 tag | ||
shell: bash | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git tag -f v1 | ||
git push -f origin v1 | ||
git tag -f v2 | ||
git push -f origin v2 |
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
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