Repository navigation
Workflow file for this run
This file contains hidden or 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
| name: decentral-data-feeder-release-pipeline | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| push_images: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Get Release Tag | |
| run: | | |
| RELEASE_TAG=${GITHUB_REF#refs/tags/} | |
| echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # 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@fa648b43de3d4d023bcb3f89ed6940096949c419 # v2 | |
| - name: Build and push image to AWS ECR | |
| env: | |
| ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
| run: | | |
| docker build -f build/Dockerfile-luminaDataFeeder -t ${ECR_REGISTRY}/lumina/decentral-data-feeder:${{ env.RELEASE_TAG }} . | |
| docker push ${ECR_REGISTRY}/lumina/decentral-data-feeder:${{ env.RELEASE_TAG }} | |
| echo "Pushed image to AWS ECR:" | |
| echo " ${ECR_REGISTRY}/lumina/decentral-data-feeder:${{ env.RELEASE_TAG }}" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Set SemVer tag | |
| run: | | |
| SEMVER_TAG=${RELEASE_TAG#v} | |
| echo "SEMVER_TAG=$SEMVER_TAG" >> $GITHUB_ENV | |
| - name: Build & Push Multi-arch to Docker Hub | |
| uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4 | |
| timeout-minutes: 30 | |
| with: | |
| context: . | |
| file: build/Dockerfile-luminaDataFeeder | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| diadata/decentralized-data-feeder:${{ env.SEMVER_TAG }} | |
| ${{ !contains(env.SEMVER_TAG, '-') && 'diadata/decentralized-data-feeder:latest' || '' }} | |
| cache-from: type=registry,ref=diadata/decentralized-data-feeder:buildcache | |
| cache-to: type=registry,ref=diadata/decentralized-data-feeder:buildcache,mode=max | |
| - name: Logout | |
| run: docker logout |