Skip to content

Commit

Permalink
Test publish to ECR
Browse files Browse the repository at this point in the history
  • Loading branch information
Lihi Zitzer committed Nov 4, 2024
1 parent 11a760d commit 64a71a2
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 538 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/release-test-lihi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
# This workflow is triggered whenever we release a new version of Starboard
# by creating an annotated Git tag and pushing it to the upstream Git repository.
#
# git tag -a v0.0.1 -m 'Release v0.0.1'
# git push upstream v0.0.1
name: Release
on:
push:
branches:
- lihitest-release-*
env:
GO_VERSION: "1.23.1"
KIND_VERSION: "v0.11.1"
KIND_IMAGE: "kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6"
jobs:
release:
name: Release-Test-Lihi
runs-on: ubuntu-20.04
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Cleanup Docker and KIND resources (Pre-Release)
run: |
docker system prune -a --force
docker volume prune --force
- name: Check disk usage (Pre-Release)
run: df -h
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR - Lihitest
id: login-ecr
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
# - name: Login to docker.io registry
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USER }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Release
uses: goreleaser/goreleaser-action@v3
with:
version: v1.7.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Update new version for plugin 'starboard' in krew-index
# uses: rajatjindal/[email protected]

# - name: Tag and push image to Amazon ECR
# id: build-image
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: ${{ github.sha }}
# run: |
# # push to ECR
# docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_ECR
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
# echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Cleanup Docker and KIND resources
run: |
docker system prune -a --force
docker volume prune --force
- name: Check disk usage
run: df -h
Loading

0 comments on commit 64a71a2

Please sign in to comment.