Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Update release CI (#389)
Browse files Browse the repository at this point in the history
* Don't tag image as `stable` if the version is a release candidate (rc)

* Stop deploying commander on new release

* Change release CI display name
  • Loading branch information
Michał Sieczkowski authored Oct 13, 2021
1 parent 6dc2be9 commit d866dff
Showing 1 changed file with 10 additions and 50 deletions.
60 changes: 10 additions & 50 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Test
name: Release
on:
release:
types: [created]
Expand All @@ -16,60 +16,20 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set tag name
id: tag_name
- name: Evaluate image tags
id: evaluate-tags
run: |
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
VERSION_TAG=${GITHUB_REF#refs/tags/}
if [[ $VERSION_TAG == *"rc"* ]]; then
echo ::set-output name=IMAGE_TAGS::ghcr.io/worldcoin/hubble-commander:${VERSION_TAG}
else
echo ::set-output name=IMAGE_TAGS::ghcr.io/worldcoin/hubble-commander:${VERSION_TAG},ghcr.io/worldcoin/hubble-commander:stable
fi
- name: Build docker image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/worldcoin/hubble-commander:${{ steps.tag_name.outputs.SOURCE_TAG }},ghcr.io/worldcoin/hubble-commander:stable

deploy-backend-api-staging:
runs-on: ubuntu-20.04
needs: [build]
steps:
- name: Configure AWS EKS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.STAGING_BACKEND_API_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.STAGING_BACKEND_API_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Download kubeconfig
run: |
aws eks --region us-east-1 update-kubeconfig --name new-staging --kubeconfig $GITHUB_WORKSPACE/kubeconfig
- name: Install kubectl
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x ./kubectl
- name: Set tag name
id: tag_name
run: |
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Update deployment in the cluster
run: |
./kubectl --kubeconfig ./kubeconfig --namespace=staging set image deployments/hubble-commander primary-hubble-commander=ghcr.io/worldcoin/hubble-commander:${{ steps.tag_name.outputs.SOURCE_TAG }} secondary-hubble-commander=ghcr.io/worldcoin/hubble-commander:${{ steps.tag_name.outputs.SOURCE_TAG }}
deploy:
name: Deploy to AWS
needs: build
runs-on: ubuntu-20.04
strategy:
matrix:
host: [ec2-3-238-223-141.compute-1.amazonaws.com, ec2-3-239-149-30.compute-1.amazonaws.com]
steps:
- name: Deploy to AWS
uses: appleboy/ssh-action@master
with:
host: ${{ matrix.host }}
username: ec2-user
key: ${{ secrets.AWS_SSH_KEY }}
script_stop: true
script: |
docker-compose pull
docker-compose up -d
docker images -f "before=ghcr.io/worldcoin/hubble-commander:stable" -f "dangling=true" -q ghcr.io/worldcoin/hubble-commander | xargs docker image rm || true
tags: ${{ steps.evaluate-tags.outputs.IMAGE_TAGS }}

0 comments on commit d866dff

Please sign in to comment.